Reviewers: Dmitry Lomov (chromium),
Description:
Remove @@create and don't expose unimplemented symbols
Also, add some bits missing from turn-on-symbols CL
[email protected]
BUG=
Please review this at https://codereview.chromium.org/441943002/
SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge
Affected files (+20, -19 lines):
M BUILD.gn
M src/bootstrapper.cc
M src/symbol.js
M test/mjsunit/es6/symbols.js
Index: BUILD.gn
diff --git a/BUILD.gn b/BUILD.gn
index
b5830bf9dd82914fbf6d563f14e43c8c71903a0e..f0d600ee7b7d64b98659ee4123d56ff67dbee01c
100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -192,6 +192,7 @@ action("js2c") {
"src/v8natives.js",
"src/array.js",
"src/string.js",
+ "src/symbol.js",
"src/uri.js",
"src/math.js",
"src/messages.js",
@@ -244,7 +245,6 @@ action("js2c_experimental") {
sources = [
"src/macros.py",
- "src/symbol.js",
"src/proxy.js",
"src/collection.js",
"src/collection-iterator.js",
Index: src/bootstrapper.cc
diff --git a/src/bootstrapper.cc b/src/bootstrapper.cc
index
545d015a228a95bd3d38a2745c7f2f47ff6f66cf..07a6c932c41649676caed9738e3d21cfcae50857
100644
--- a/src/bootstrapper.cc
+++ b/src/bootstrapper.cc
@@ -982,6 +982,14 @@ void Genesis::InitializeGlobal(Handle<GlobalObject>
global_object,
}
}
+ {
+ // --- S y m b o l ---
+ Handle<JSFunction> symbol_fun = InstallFunction(
+ global, "Symbol", JS_VALUE_TYPE, JSValue::kSize,
+ isolate->initial_object_prototype(), Builtins::kIllegal);
+ native_context()->set_symbol_function(*symbol_fun);
+ }
+
{ // --- D a t e ---
// Builtin functions for Date.prototype.
Handle<JSFunction> date_fun =
@@ -1134,14 +1142,6 @@ void Genesis::InitializeGlobal(Handle<GlobalObject>
global_object,
InstallFunction(global, "WeakSet", JS_WEAK_SET_TYPE, JSWeakSet::kSize,
isolate->initial_object_prototype(), Builtins::kIllegal);
- {
- // --- S y m b o l ---
- Handle<JSFunction> symbol_fun = InstallFunction(
- global, "Symbol", JS_VALUE_TYPE, JSValue::kSize,
- isolate->initial_object_prototype(), Builtins::kIllegal);
- native_context()->set_symbol_function(*symbol_fun);
- }
-
{ // --- sloppy arguments map
// Make sure we can recognize argument objects at runtime.
// This is done by introducing an anonymous function with
@@ -1621,6 +1621,7 @@ void Genesis::InstallNativeFunctions() {
native_object_get_notifier);
INSTALL_NATIVE(JSFunction, "NativeObjectNotifierPerformChange",
native_object_notifier_perform_change);
+
INSTALL_NATIVE(Symbol, "symbolIterator", iterator_symbol);
INSTALL_NATIVE_MATH(abs)
Index: src/symbol.js
diff --git a/src/symbol.js b/src/symbol.js
index
0ac3a125a0998ec0ab2fe6aa1385aa0226da7f82..7b855c70fc96e1da2a1e9b51d08f5aa544f90a3a
100644
--- a/src/symbol.js
+++ b/src/symbol.js
@@ -82,7 +82,6 @@ function ObjectGetOwnPropertySymbols(obj) {
//-------------------------------------------------------------------
-var symbolCreate = InternalSymbol("Symbol.create");
var symbolHasInstance = InternalSymbol("Symbol.hasInstance");
var symbolIsConcatSpreadable = InternalSymbol("Symbol.isConcatSpreadable");
var symbolIsRegExp = InternalSymbol("Symbol.isRegExp");
@@ -100,13 +99,13 @@ function SetUpSymbol() {
%FunctionSetPrototype($Symbol, new $Object());
InstallConstants($Symbol, $Array(
- "create", symbolCreate,
- "hasInstance", symbolHasInstance,
- "isConcatSpreadable", symbolIsConcatSpreadable,
- "isRegExp", symbolIsRegExp,
- "iterator", symbolIterator,
- "toStringTag", symbolToStringTag,
- "unscopables", symbolUnscopables
+ // TODO(rossberg): expose when implemented.
+ // "hasInstance", symbolHasInstance,
+ // "isConcatSpreadable", symbolIsConcatSpreadable,
+ // "isRegExp", symbolIsRegExp,
+ "iterator", symbolIterator
+ // "toStringTag", symbolToStringTag,
+ // "unscopables", symbolUnscopables
));
InstallFunctions($Symbol, DONT_ENUM, $Array(
"for", SymbolFor,
Index: test/mjsunit/es6/symbols.js
diff --git a/test/mjsunit/es6/symbols.js b/test/mjsunit/es6/symbols.js
index
a57c9b2ec42d9b1ccd75c453244944ca78eee7f2..1422bb3b593711eb8574f43803a2f94383b7896e
100644
--- a/test/mjsunit/es6/symbols.js
+++ b/test/mjsunit/es6/symbols.js
@@ -446,8 +446,9 @@ TestGetOwnPropertySymbolsWithProto()
function TestWellKnown() {
var symbols = [
- "create", "hasInstance", "isConcatSpreadable", "isRegExp",
- "iterator", "toStringTag", "unscopables"
+ // TODO(rossberg): reactivate once implemented.
+ // "hasInstance", "isConcatSpreadable", "isRegExp",
+ "iterator" //, "toStringTag", "unscopables"
]
for (var i in symbols) {
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.