// Flags for language modes and experimental language features.
DEFINE_bool(use_strict, false, "enforce strict mode")
-DEFINE_bool(es5_readonly, true,
- "activate correct semantics for inheriting readonliness")
-DEFINE_bool(es52_globals, true,
- "activate new semantics for global var declarations")
+DEFINE_bool(es_staging, false, "enable upcoming ES6+ features")
DEFINE_bool(harmony_typeof, false, "enable harmony semantics for typeof")
DEFINE_bool(harmony_scoping, false, "enable harmony block scoping")
DEFINE_bool(harmony_arrays, false, "enable harmony arrays")
DEFINE_bool(harmony_maths, false, "enable harmony math functions")
DEFINE_bool(harmony, false, "enable all harmony features (except typeof)")
+DEFINE_implication(harmony, es_staging)
DEFINE_implication(harmony, harmony_scoping)
DEFINE_implication(harmony, harmony_modules)
DEFINE_implication(harmony, harmony_symbols)
break;
}
case CALLBACKS: {
- if (!FLAG_es5_readonly && result.IsReadOnly()) break;
*done = true;
Handle<Object> callback_object(result.GetCallbackObject(), isolate);
return SetPropertyWithCallback(object, callback_object, name, value,
}
// If we get here with *done true, we have encountered a read-only property.
- if (!FLAG_es5_readonly) *done = false;
if (*done) {
if (strict_mode == kNonStrictMode) return value;
Handle<Object> args[] = { name, object };
// value of the variable if the property is already there.
// Do the lookup locally only, see ES5 erratum.
LookupResult lookup(isolate);
- if (FLAG_es52_globals) {
- global->LocalLookup(*name, &lookup, true);
- } else {
- global->Lookup(*name, &lookup);
- }
+ global->LocalLookup(*name, &lookup, true);
if (lookup.IsFound()) {
// We found an existing property. Unless it was an interceptor
// that claims the property is absent, skip this declaration.
THREADED_TEST(Overriding) {
- i::FLAG_es5_readonly = true;
LocalContext context;
v8::Isolate* isolate = context->GetIsolate();
v8::HandleScope scope(isolate);
// Test that we cannot set a property on the global object if there
// is a read-only property in the prototype chain.
TEST(ReadOnlyPropertyInGlobalProto) {
- i::FLAG_es5_readonly = true;
v8::Isolate* isolate = CcTest::isolate();
v8::HandleScope scope(isolate);
v8::Handle<v8::ObjectTemplate> templ = v8::ObjectTemplate::New(isolate);
// Check that a variable declaration with no explicit initialization
// value does shadow an existing property in the prototype chain.
THREADED_TEST(InitGlobalVarInProtoChain) {
- i::FLAG_es52_globals = true;
LocalContext context;
v8::HandleScope scope(context->GetIsolate());
// Introduce a variable in the prototype chain.
TEST(ExistsInPrototype) {
- i::FLAG_es52_globals = true;
HandleScope scope(CcTest::isolate());
// Sanity check to make sure that the holder of the interceptor
TEST(AbsentInPrototype) {
- i::FLAG_es52_globals = true;
v8::V8::Initialize();
HandleScope scope(CcTest::isolate());
TEST(ExistsInHiddenPrototype) {
- i::FLAG_es52_globals = true;
HandleScope scope(CcTest::isolate());
{ ExistsInHiddenPrototypeContext context;