Enable --harmony-strict-legacy-accessor-builtins by default

This behavior has been staged successfully without a bug report, and
has been shipped in the latest versions of Firefox and Safari.

Bug: v8:5070
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel
Change-Id: I084cae2cc303d6a213bd6789297b91656e162d6b
Reviewed-on: https://chromium-review.googlesource.com/595129
Reviewed-by: Daniel Ehrenberg <littledan@chromium.org>
Commit-Queue: Adam Klein <adamk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47098}
This commit is contained in:
Adam Klein 2017-07-31 17:40:22 -07:00 committed by Commit Bot
parent a75517387d
commit 74edfccd45
7 changed files with 21 additions and 14 deletions

View File

@ -212,8 +212,6 @@ DEFINE_IMPLICATION(es_staging, harmony)
V(harmony_function_tostring, "harmony Function.prototype.toString") \
V(harmony_regexp_named_captures, "harmony regexp named captures") \
V(harmony_regexp_property, "harmony Unicode regexp property classes") \
V(harmony_strict_legacy_accessor_builtins, \
"treat __defineGetter__ and related functions as strict") \
V(harmony_template_escapes, \
"harmony invalid escapes in tagged template literals") \
V(harmony_restrict_constructor_return, \
@ -223,6 +221,8 @@ DEFINE_IMPLICATION(es_staging, harmony)
// Features that are shipping (turned on by default, but internal flag remains).
#define HARMONY_SHIPPING(V) \
V(harmony_strict_legacy_accessor_builtins, \
"treat __defineGetter__ and related functions as strict") \
V(harmony_restrictive_generators, \
"harmony restrictions on generator declarations") \
V(harmony_object_rest_spread, "harmony object rest spread properties") \

View File

@ -16459,11 +16459,12 @@ static void ObjectWithExternalArrayTestHelper(Local<Context> context,
"ext_array[3];");
CHECK_EQ(33, result->Int32Value(context).FromJust());
result = CompileRun("ext_array[0] = 10; ext_array[1] = 11;"
"ext_array[2] = 12; ext_array[3] = 13;"
"ext_array.__defineGetter__('2',"
"function() { return 120; });"
"ext_array[2];");
result = CompileRun(
"ext_array[0] = 10; ext_array[1] = 11;"
"ext_array[2] = 12; ext_array[3] = 13;"
"try { ext_array.__defineGetter__('2', function() { return 120; }); }"
"catch (e) { }"
"ext_array[2];");
CHECK_EQ(12, result->Int32Value(context).FromJust());
result = CompileRun("var js_array = new Array(40);"

View File

@ -17,6 +17,7 @@ void MockUseCounterCallback(v8::Isolate* isolate,
}
TEST(DefineGetterSetterThrowUseCount) {
i::FLAG_harmony_strict_legacy_accessor_builtins = false;
v8::Isolate* isolate = CcTest::isolate();
v8::HandleScope scope(isolate);
LocalContext env;

View File

@ -34,7 +34,7 @@ function getX() { return x; }
for (var i = 0; i < 10; i++) {
assertEquals(i < 5 ? 0 : 42, getX());
if (i == 4) __defineGetter__("x", function() { return 42; });
if (i == 4) this.__defineGetter__("x", function() { return 42; });
}
@ -50,8 +50,8 @@ for (var i = 0; i < 10; i++) {
setY(i);
assertEquals(i < 5 ? i : 2 * i, y);
if (i == 4) {
__defineSetter__("y", function(value) { setter_y = 2 * value; });
__defineGetter__("y", function() { return setter_y; });
this.__defineSetter__("y", function(value) { setter_y = 2 * value; });
this.__defineGetter__("y", function() { return setter_y; });
}
}
@ -59,7 +59,7 @@ for (var i = 0; i < 10; i++) {
// Test that replacing a getter with a normal property works as
// expected.
__defineGetter__("z", function() { return 42; });
this.__defineGetter__("z", function() { return 42; });
function getZ() { return z; }

View File

@ -37,8 +37,8 @@ function getx(){
setx()
setx()
__defineSetter__('x',function(){});
__defineGetter__('x',function(){return 2;});
this.__defineSetter__('x',function(){});
this.__defineGetter__('x',function(){return 2;});
setx()
assertEquals(2, x);

View File

@ -3,6 +3,6 @@
// found in the LICENSE file.
// Access any property that's also available on the global of the other realm.
__defineGetter__("Object", ()=>0);
this.__defineGetter__("Object", ()=>0);
__proto__ = Realm.global(Realm.create());
Object;

View File

@ -804,6 +804,11 @@
# error message in debug mode.
'js1_5/extensions/regress-336410-1': [FAIL_OK, ['mode == debug and arch == x64', NO_VARIANTS]],
# These tests fail when --harmony-strict-legacy-accessor-builtins
# is enabled.
'js1_5/extensions/regress-313500': [SKIP],
'js1_5/extensions/regress-325269': [SKIP],
##################### DECOMPILATION TESTS #####################
# We don't really about the outcome of running the