зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1138489 - Remove JSPROP_INDEX. r=Waldo.
--HG-- extra : rebase_source : 1683c18d73088c5a4b6136fe4bb7bc0422912e71 extra : amend_source : c79c4ea47e00e6d9d9f786151bd1ab62dd00b78a
This commit is contained in:
Родитель
fae53e811b
Коммит
28e06d157a
|
@ -2368,16 +2368,10 @@ DefineProperty(JSContext *cx, HandleObject obj, const char *name, HandleValue va
|
|||
AutoRooterGetterSetter gsRoot(cx, attrs, const_cast<JSNative *>(&getter.op),
|
||||
const_cast<JSNative *>(&setter.op));
|
||||
|
||||
RootedId id(cx);
|
||||
if (attrs & JSPROP_INDEX) {
|
||||
id = INT_TO_JSID(intptr_t(name));
|
||||
attrs &= ~JSPROP_INDEX;
|
||||
} else {
|
||||
JSAtom *atom = Atomize(cx, name, strlen(name));
|
||||
if (!atom)
|
||||
return false;
|
||||
id = AtomToId(atom);
|
||||
}
|
||||
JSAtom *atom = Atomize(cx, name, strlen(name));
|
||||
if (!atom)
|
||||
return false;
|
||||
RootedId id(cx, AtomToId(atom));
|
||||
|
||||
return DefinePropertyById(cx, obj, id, value, getter, setter, attrs, flags);
|
||||
}
|
||||
|
|
|
@ -896,7 +896,7 @@ class MOZ_STACK_CLASS SourceBufferHolder final
|
|||
set of the same-named property in an
|
||||
object that delegates to a prototype
|
||||
containing this property */
|
||||
#define JSPROP_INDEX 0x80 /* name is actually (int) index */
|
||||
#define JSPROP_INTERNAL_USE_BIT 0x80 /* internal JS engine use only */
|
||||
#define JSPROP_DEFINE_LATE 0x100 /* Don't define property when initially creating
|
||||
the constructor. Some objects like Function/Object
|
||||
have self-hosted functions that can only be defined
|
||||
|
@ -2019,9 +2019,9 @@ typedef struct JSNativeWrapper {
|
|||
#define JSNATIVE_WRAPPER(native) { {native, nullptr} }
|
||||
|
||||
/*
|
||||
* To define an array element rather than a named property member, cast the
|
||||
* element's index to (const char *) and initialize name with it, and set the
|
||||
* JSPROP_INDEX bit in flags.
|
||||
* Description of a property. JS_DefineProperties and JS_InitClass take arrays
|
||||
* of these and define many properties at once. JS_PSG, JS_PSGS and JS_PS_END
|
||||
* are helper macros for defining such arrays.
|
||||
*/
|
||||
struct JSPropertySpec {
|
||||
struct SelfHostedWrapper {
|
||||
|
|
|
@ -262,9 +262,9 @@ class ShapeTable {
|
|||
};
|
||||
|
||||
/*
|
||||
* Reuse the API-only JSPROP_INDEX attribute to mean shadowability.
|
||||
* Use the reserved attribute bit to mean shadowability.
|
||||
*/
|
||||
#define JSPROP_SHADOWABLE JSPROP_INDEX
|
||||
#define JSPROP_SHADOWABLE JSPROP_INTERNAL_USE_BIT
|
||||
|
||||
/*
|
||||
* Shapes encode information about both a property lineage *and* a particular
|
||||
|
|
Загрузка…
Ссылка в новой задаче