зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1131043 - Part 1: Add Symbol.species. r=evilpie
This commit is contained in:
Родитель
3116f3bf53
Коммит
c240fdbf02
|
@ -4347,12 +4347,13 @@ GetSymbolDescription(HandleSymbol symbol);
|
|||
enum class SymbolCode : uint32_t {
|
||||
iterator, // Symbol.iterator
|
||||
match, // Symbol.match
|
||||
species, // Symbol.species
|
||||
InSymbolRegistry = 0xfffffffe, // created by Symbol.for() or JS::GetSymbolFor()
|
||||
UniqueSymbol = 0xffffffff // created by Symbol() or JS::NewSymbol()
|
||||
};
|
||||
|
||||
/* For use in loops that iterate over the well-known symbols. */
|
||||
const size_t WellKnownSymbolLimit = 2;
|
||||
const size_t WellKnownSymbolLimit = 3;
|
||||
|
||||
/*
|
||||
* Return the SymbolCode telling what sort of symbol `symbol` is.
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
var names = [
|
||||
"iterator",
|
||||
"match",
|
||||
"species",
|
||||
];
|
||||
|
||||
for (var name of names) {
|
||||
|
|
|
@ -248,6 +248,7 @@
|
|||
* enum JS::SymbolCode in jsapi.h. */ \
|
||||
macro(iterator, iterator, "iterator") \
|
||||
macro(match, match, "match") \
|
||||
macro(species, species, "species") \
|
||||
/* Same goes for the descriptions of the well-known symbols. */ \
|
||||
macro(Symbol_create, Symbol_create, "Symbol.create") \
|
||||
macro(Symbol_hasInstance, Symbol_hasInstance, "Symbol.hasInstance") \
|
||||
|
@ -255,6 +256,7 @@
|
|||
macro(Symbol_isRegExp, Symbol_isRegExp, "Symbol.isRegExp") \
|
||||
macro(Symbol_iterator, Symbol_iterator, "Symbol.iterator") \
|
||||
macro(Symbol_match, Symbol_match, "Symbol.match") \
|
||||
macro(Symbol_species, Symbol_species, "Symbol.species") \
|
||||
macro(Symbol_toPrimitive, Symbol_toPrimitive, "Symbol.toPrimitive") \
|
||||
macro(Symbol_toStringTag, Symbol_toStringTag, "Symbol.toStringTag") \
|
||||
macro(Symbol_unscopables, Symbol_unscopables, "Symbol.unscopables") \
|
||||
|
|
|
@ -430,6 +430,7 @@ struct WellKnownSymbols
|
|||
{
|
||||
js::ImmutableSymbolPtr iterator;
|
||||
js::ImmutableSymbolPtr match;
|
||||
js::ImmutableSymbolPtr species;
|
||||
|
||||
const ImmutableSymbolPtr& get(size_t u) const {
|
||||
MOZ_ASSERT(u < JS::WellKnownSymbolLimit);
|
||||
|
|
Загрузка…
Ссылка в новой задаче