mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1138489 - Remove JSPROP_INDEX. r=Waldo.
This commit is contained in:
parent
5e9638acb9
commit
af0f23e9c5
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user