Commit 51d28914 authored by adamk's avatar adamk Committed by Commit bot

[es6] Function constructor-created functions should be named "anonymous"

Besides matching the spec, this matches the behavior of Firefox and Edge.

BUG=v8:3699
LOG=n
CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel

Review URL: https://codereview.chromium.org/1377603006

Cr-Commit-Position: refs/heads/master@{#31030}
parent bab3b550
......@@ -1074,7 +1074,12 @@ void Accessors::FunctionNameGetter(
HandleScope scope(isolate);
Handle<JSFunction> function =
Handle<JSFunction>::cast(Utils::OpenHandle(*info.Holder()));
Handle<Object> result(function->shared()->name(), isolate);
Handle<Object> result;
if (function->shared()->name_should_print_as_anonymous()) {
result = isolate->factory()->anonymous_string();
} else {
result = handle(function->shared()->name(), isolate);
}
info.GetReturnValue().Set(Utils::ToLocal(result));
}
......
......@@ -303,7 +303,8 @@ namespace internal {
V(minus_zero_string, "-0") \
V(Array_string, "Array") \
V(Error_string, "Error") \
V(RegExp_string, "RegExp")
V(RegExp_string, "RegExp") \
V(anonymous_string, "anonymous")
#define PRIVATE_SYMBOL_LIST(V) \
V(array_iteration_kind_symbol) \
......
......@@ -423,8 +423,6 @@
'language/expressions/assignment/S11.13.1_A6*': [FAIL],
# https://code.google.com/p/v8/issues/detail?id=3699
'built-ins/Function/instance-name': [FAIL],
'built-ins/GeneratorFunction/instance-name': [FAIL],
'language/expressions/assignment/fn-name-arrow': [FAIL],
'language/expressions/assignment/fn-name-class': [FAIL],
'language/expressions/assignment/fn-name-cover': [FAIL],
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment