Commit 6f4aea95 authored by rossberg@chromium.org's avatar rossberg@chromium.org

Remove @@create and don't expose unimplemented symbols

Also, add some bits missing from turn-on-symbols CL

R=adamk@chromium.org, dslomov@chromium.org
BUG=

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

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@22910 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent b8ab8220
......@@ -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 =
......@@ -1169,14 +1177,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
......@@ -1593,6 +1593,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)
......
......@@ -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,
......
......@@ -445,8 +445,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) {
......
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