Introduce string/regexp related public symbols.

R=littledan@chromium.org
BUG=v8:4305, v8:4343, v8:4344, v8:4345
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#31643}
This commit is contained in:
yangguo 2015-10-28 22:24:32 -07:00 committed by Commit bot
parent e933b091df
commit 6812883494
2 changed files with 19 additions and 6 deletions

View File

@ -358,6 +358,10 @@ namespace internal {
V(has_instance_symbol, Symbol.hasInstance) \ V(has_instance_symbol, Symbol.hasInstance) \
V(is_regexp_symbol, Symbol.isRegExp) \ V(is_regexp_symbol, Symbol.isRegExp) \
V(iterator_symbol, Symbol.iterator) \ V(iterator_symbol, Symbol.iterator) \
V(match_symbol, Symbol.match) \
V(replace_symbol, Symbol.replace) \
V(search_symbol, Symbol.search) \
V(split_symbol, Symbol.split) \
V(to_primitive_symbol, Symbol.toPrimitive) \ V(to_primitive_symbol, Symbol.toPrimitive) \
V(to_string_tag_symbol, Symbol.toStringTag) \ V(to_string_tag_symbol, Symbol.toStringTag) \
V(unscopables_symbol, Symbol.unscopables) V(unscopables_symbol, Symbol.unscopables)

View File

@ -19,7 +19,11 @@ var isConcatSpreadableSymbol =
var isRegExpSymbol = utils.ImportNow("is_regexp_symbol"); var isRegExpSymbol = utils.ImportNow("is_regexp_symbol");
var iteratorSymbol = utils.ImportNow("iterator_symbol"); var iteratorSymbol = utils.ImportNow("iterator_symbol");
var MakeTypeError; var MakeTypeError;
var matchSymbol = utils.ImportNow("match_symbol");
var ObjectGetOwnPropertyKeys; var ObjectGetOwnPropertyKeys;
var replaceSymbol = utils.ImportNow("replace_symbol");
var searchSymbol = utils.ImportNow("search_symbol");
var splitSymbol = utils.ImportNow("split_symbol");
var toPrimitiveSymbol = utils.ImportNow("to_primitive_symbol"); var toPrimitiveSymbol = utils.ImportNow("to_primitive_symbol");
var toStringTagSymbol = utils.ImportNow("to_string_tag_symbol"); var toStringTagSymbol = utils.ImportNow("to_string_tag_symbol");
var unscopablesSymbol = utils.ImportNow("unscopables_symbol"); var unscopablesSymbol = utils.ImportNow("unscopables_symbol");
@ -96,6 +100,11 @@ utils.InstallConstants(GlobalSymbol, [
// "isConcatSpreadable", isConcatSpreadableSymbol, // "isConcatSpreadable", isConcatSpreadableSymbol,
// "isRegExp", isRegExpSymbol, // "isRegExp", isRegExpSymbol,
"iterator", iteratorSymbol, "iterator", iteratorSymbol,
// TODO(yangguo): expose when implemented.
// "match", matchSymbol,
// "replace", replaceSymbol,
// "search", searchSymbol,
// "split, splitSymbol,
"toPrimitive", toPrimitiveSymbol, "toPrimitive", toPrimitiveSymbol,
// TODO(dslomov, caitp): Currently defined in harmony-tostring.js --- // TODO(dslomov, caitp): Currently defined in harmony-tostring.js ---
// Move here when shipping // Move here when shipping