Commit 47e0a392 authored by cbruni's avatar cbruni Committed by Commit bot

Setting Symbol.length to 0 according to the spec

BUG=v8:4882
LOG=n

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

Cr-Commit-Position: refs/heads/master@{#35255}
parent ce033d56
...@@ -1259,7 +1259,7 @@ void Genesis::InitializeGlobal(Handle<JSGlobalObject> global_object, ...@@ -1259,7 +1259,7 @@ void Genesis::InitializeGlobal(Handle<JSGlobalObject> global_object,
prototype, Builtins::kSymbolConstructor); prototype, Builtins::kSymbolConstructor);
symbol_fun->shared()->set_construct_stub( symbol_fun->shared()->set_construct_stub(
*isolate->builtins()->SymbolConstructor_ConstructStub()); *isolate->builtins()->SymbolConstructor_ConstructStub());
symbol_fun->shared()->set_length(1); symbol_fun->shared()->set_length(0);
symbol_fun->shared()->DontAdaptArguments(); symbol_fun->shared()->DontAdaptArguments();
native_context()->set_symbol_function(*symbol_fun); native_context()->set_symbol_function(*symbol_fun);
......
...@@ -86,6 +86,7 @@ TestPrototype() ...@@ -86,6 +86,7 @@ TestPrototype()
function TestConstructor() { function TestConstructor() {
assertEquals(0, Symbol.length);
assertSame(Function.prototype, Symbol.__proto__) assertSame(Function.prototype, Symbol.__proto__)
assertFalse(Object === Symbol.prototype.constructor) assertFalse(Object === Symbol.prototype.constructor)
assertFalse(Symbol === Object.prototype.constructor) assertFalse(Symbol === Object.prototype.constructor)
......
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