Revert "Enable --harmony-function-tostring by default"

This reverts commit c3dda0bbac.

Reason for revert: Breaks gc stress bots:
https://build.chromium.org/p/client.v8/builders/V8%20Linux%20-%20gc%20stress/builds/14266

Original change's description:
> Enable --harmony-function-tostring by default
>
> Update tests to work with new behavior.
>
> This feature is shipping in Firefox 54, so compatibility risk is low.
>
> R=​littledan@chromium.org, adamk@chromium.org, caitp@igalia.com
> CQ_INCLUDE_TRYBOTS=master.tryserver.blink:linux_trusty_blink_rel
>
> Bug: v8:4958
> Cq-Include-Trybots: master.tryserver.v8:v8_linux_noi18n_rel_ng
> Change-Id: Ib16d19468cf935f961d7bcd856ebbeb5692d3e61
> Reviewed-on: https://chromium-review.googlesource.com/546941
> Commit-Queue: Josh Wolfe <jwolfe@igalia.com>
> Reviewed-by: Adam Klein <adamk@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#50178}

TBR=adamk@chromium.org,hablich@chromium.org,kozyatinskiy@chromium.org,littledan@chromium.org,caitp@igalia.com,jwolfe@igalia.com

Change-Id: Ie5dd0bd2b97ae6d0126edec6373e48abe0eeb3f0
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: v8:4958
Reviewed-on: https://chromium-review.googlesource.com/832649
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#50182}
This commit is contained in:
Michael Achenbach 2017-12-19 07:38:42 +00:00 committed by Commit Bot
parent 2c4704abf5
commit 4faed83040
7 changed files with 15 additions and 20 deletions

View File

@ -210,6 +210,7 @@ DEFINE_IMPLICATION(harmony_class_fields, harmony_public_fields)
// Features that are complete (but still behind --harmony/es-staging flag).
#define HARMONY_STAGED(V) \
V(harmony_function_tostring, "harmony Function.prototype.toString") \
V(harmony_restrict_constructor_return, \
"harmony disallow non undefined primitive return value from class " \
"constructor") \
@ -221,7 +222,6 @@ DEFINE_IMPLICATION(harmony_class_fields, harmony_public_fields)
V(harmony_regexp_named_captures, "harmony regexp named captures") \
V(harmony_regexp_property, "harmony Unicode regexp property classes") \
V(harmony_async_iteration, "harmony async iteration") \
V(harmony_function_tostring, "harmony Function.prototype.toString") \
V(harmony_promise_finally, "harmony Promise.prototype.finally")
#ifdef V8_INTL_SUPPORT

View File

@ -1,6 +1,6 @@
undefined:1: SyntaxError: Arg string terminates parameters early
(function anonymous()
^
SyntaxError: Arg string terminates parameters early
*%(basename)s:29: SyntaxError: Function arg string contains parenthesis
var paren_in_arg_string_bad = new Function(')', 'return;');
^
SyntaxError: Function arg string contains parenthesis
at new Function (<anonymous>)
at *%(basename)s:29:31

View File

@ -153,7 +153,7 @@ async function* asyncGeneratorForToString() {}
assertEquals("async function* asyncGeneratorForToString() {}",
asyncGeneratorForToString.toString());
assertEquals("async function*() {}", async function*() {}.toString());
assertEquals("async function* () {}", async function*() {}.toString());
assertEquals("async function* namedAsyncGeneratorForToString() {}",
async function* namedAsyncGeneratorForToString() {}.toString());
@ -164,9 +164,9 @@ assertEquals("async *method() { }",
assertEquals("async *method() { }",
(new (class { async *method() { } })).method.toString());
assertEquals("async function* anonymous(\n) {\n\n}",
assertEquals("async function* anonymous() {\n\n}",
AsyncGeneratorFunction().toString());
assertEquals("async function* anonymous(\n) {\n\n}",
assertEquals("async function* anonymous() {\n\n}",
(new AsyncGeneratorFunction()).toString());
// ----------------------------------------------------------------------------

View File

@ -46,4 +46,4 @@ assertThrows('Function("a", "", "//", "//")', SyntaxError);
// Some embedders rely on the string representation of the resulting
// function in cases where no formal parameters are specified.
var asString = Function("return 23").toString();
assertSame("function anonymous(\n) {\nreturn 23\n}", asString);
assertSame("function anonymous() {\nreturn 23\n}", asString);

View File

@ -14,16 +14,15 @@ function test(expectation, f) {
}
/*
(function(
) {
(function() {
1 + reference_error //@ sourceURL=evaltest
})
*/
test("3:5", new Function(
test("2:5", new Function(
'1 + reference_error //@ sourceURL=evaltest'));
/*
(function(x
) {
/\**\/) {
1 + reference_error //@ sourceURL=evaltest
})
@ -35,7 +34,7 @@ test("4:6", new Function(
,z//
,y
) {
/\**\/) {
1 + reference_error //@ sourceURL=evaltest
})
@ -45,7 +44,7 @@ test("7:6", new Function(
/*
(function(x/\*,z//
,y*\/
) {
/\**\/) {
1 + reference_error //@ sourceURL=evaltest
})
*/

View File

@ -4,5 +4,5 @@
function alert(x) {};
assertThrows(
'Function("a=`","`,xss=1){alert(xss)")'
Function("a=`","`,xss=1){alert(xss)")
);

View File

@ -118,10 +118,6 @@
# Invalid according to ES2015 syntax. (Details: crbug.com/726625)
'ecma_3/extensions/regress-368516': [FAIL],
# Function.prototype.toString revision.
# (https://chromium-review.googlesource.com/c/546941#message-5dc0f5efe277388501e8870e39ec70383dfc7db8)
'js1_5/Scope/regress-185485': [FAIL],
##################### SKIPPED TESTS #####################
# This test checks that we behave properly in an out-of-memory