зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1447442 - Part 6: Pass Handle<GlobalObject*> in ClassInitializerOp. r=jorendorff
--HG-- extra : rebase_source : 14883f96b9df11ae22cf427e104a8a2689b1e4bb
This commit is contained in:
Родитель
4adabc626b
Коммит
c58317ae7c
|
@ -679,9 +679,6 @@ inline void assertEnteredPolicy(JSContext* cx, JSObject* obj, jsid id,
|
|||
{}
|
||||
#endif
|
||||
|
||||
extern JS_FRIEND_API(JSObject*)
|
||||
InitProxyClass(JSContext* cx, JS::HandleObject obj);
|
||||
|
||||
extern JS_FRIEND_DATA(const js::ClassOps) ProxyClassOps;
|
||||
extern JS_FRIEND_DATA(const js::ClassExtension) ProxyClassExtension;
|
||||
extern JS_FRIEND_DATA(const js::ObjectOps) ProxyObjectOps;
|
||||
|
|
|
@ -1013,10 +1013,8 @@ AtomicsObject::initClass(JSContext* cx, Handle<GlobalObject*> global)
|
|||
}
|
||||
|
||||
JSObject*
|
||||
js::InitAtomicsClass(JSContext* cx, HandleObject obj)
|
||||
js::InitAtomicsClass(JSContext* cx, Handle<GlobalObject*> global)
|
||||
{
|
||||
MOZ_ASSERT(obj->is<GlobalObject>());
|
||||
Rooted<GlobalObject*> global(cx, &obj->as<GlobalObject>());
|
||||
return AtomicsObject::initClass(cx, global);
|
||||
}
|
||||
|
||||
|
|
|
@ -17,6 +17,8 @@
|
|||
|
||||
namespace js {
|
||||
|
||||
class GlobalObject;
|
||||
|
||||
class AtomicsObject : public NativeObject
|
||||
{
|
||||
public:
|
||||
|
@ -141,7 +143,7 @@ public:
|
|||
};
|
||||
|
||||
JSObject*
|
||||
InitAtomicsClass(JSContext* cx, HandleObject obj);
|
||||
InitAtomicsClass(JSContext* cx, Handle<GlobalObject*> global);
|
||||
|
||||
// Go to sleep if the int32_t value at the given address equals `value`.
|
||||
MOZ_MUST_USE FutexThread::WaitResult
|
||||
|
|
|
@ -128,12 +128,8 @@ Boolean(JSContext* cx, unsigned argc, Value* vp)
|
|||
}
|
||||
|
||||
JSObject*
|
||||
js::InitBooleanClass(JSContext* cx, HandleObject obj)
|
||||
js::InitBooleanClass(JSContext* cx, Handle<GlobalObject*> global)
|
||||
{
|
||||
MOZ_ASSERT(obj->isNative());
|
||||
|
||||
Handle<GlobalObject*> global = obj.as<GlobalObject>();
|
||||
|
||||
Rooted<BooleanObject*> booleanProto(cx, GlobalObject::createBlankPrototype<BooleanObject>(cx, global));
|
||||
if (!booleanProto)
|
||||
return nullptr;
|
||||
|
|
|
@ -15,8 +15,10 @@
|
|||
|
||||
namespace js {
|
||||
|
||||
class GlobalObject;
|
||||
|
||||
extern JSObject*
|
||||
InitBooleanClass(JSContext* cx, js::HandleObject obj);
|
||||
InitBooleanClass(JSContext* cx, js::Handle<GlobalObject*> global);
|
||||
|
||||
extern JSString*
|
||||
BooleanToString(JSContext* cx, bool b);
|
||||
|
|
|
@ -984,10 +984,8 @@ static const JSFunctionSpec json_static_methods[] = {
|
|||
};
|
||||
|
||||
JSObject*
|
||||
js::InitJSONClass(JSContext* cx, HandleObject obj)
|
||||
js::InitJSONClass(JSContext* cx, Handle<GlobalObject*> global)
|
||||
{
|
||||
Handle<GlobalObject*> global = obj.as<GlobalObject>();
|
||||
|
||||
RootedObject proto(cx, GlobalObject::getOrCreateObjectPrototype(cx, global));
|
||||
if (!proto)
|
||||
return nullptr;
|
||||
|
|
|
@ -16,12 +16,13 @@
|
|||
namespace js {
|
||||
|
||||
struct Class;
|
||||
class GlobalObject;
|
||||
class StringBuffer;
|
||||
|
||||
extern const Class JSONClass;
|
||||
|
||||
extern JSObject*
|
||||
InitJSONClass(JSContext* cx, HandleObject obj);
|
||||
InitJSONClass(JSContext* cx, Handle<GlobalObject*> obj);
|
||||
|
||||
enum class StringifyBehavior {
|
||||
Normal,
|
||||
|
|
|
@ -205,9 +205,8 @@ static const JSFunctionSpec methods[] = {
|
|||
/*** Setup **************************************************************************************/
|
||||
|
||||
JSObject*
|
||||
js::InitReflect(JSContext* cx, HandleObject obj)
|
||||
js::InitReflect(JSContext* cx, Handle<GlobalObject*> global)
|
||||
{
|
||||
Handle<GlobalObject*> global = obj.as<GlobalObject>();
|
||||
RootedObject proto(cx, GlobalObject::getOrCreateObjectPrototype(cx, global));
|
||||
if (!proto)
|
||||
return nullptr;
|
||||
|
@ -219,10 +218,10 @@ js::InitReflect(JSContext* cx, HandleObject obj)
|
|||
return nullptr;
|
||||
|
||||
RootedValue value(cx, ObjectValue(*reflect));
|
||||
if (!DefineDataProperty(cx, obj, cx->names().Reflect, value, JSPROP_RESOLVING))
|
||||
if (!DefineDataProperty(cx, global, cx->names().Reflect, value, JSPROP_RESOLVING))
|
||||
return nullptr;
|
||||
|
||||
obj->as<GlobalObject>().setConstructor(JSProto_Reflect, value);
|
||||
global->setConstructor(JSProto_Reflect, value);
|
||||
|
||||
return reflect;
|
||||
}
|
||||
|
|
|
@ -11,8 +11,10 @@
|
|||
|
||||
namespace js {
|
||||
|
||||
class GlobalObject;
|
||||
|
||||
extern JSObject*
|
||||
InitReflect(JSContext* cx, js::HandleObject obj);
|
||||
InitReflect(JSContext* cx, js::Handle<GlobalObject*> global);
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -688,9 +688,8 @@ SimdObject::resolve(JSContext* cx, JS::HandleObject obj, JS::HandleId id, bool*
|
|||
}
|
||||
|
||||
JSObject*
|
||||
js::InitSimdClass(JSContext* cx, HandleObject obj)
|
||||
js::InitSimdClass(JSContext* cx, Handle<GlobalObject*> global)
|
||||
{
|
||||
Handle<GlobalObject*> global = obj.as<GlobalObject>();
|
||||
return GlobalObject::getOrCreateSimdGlobalObject(cx, global);
|
||||
}
|
||||
|
||||
|
|
|
@ -784,6 +784,8 @@
|
|||
|
||||
namespace js {
|
||||
|
||||
class GlobalObject;
|
||||
|
||||
// Complete set of SIMD types.
|
||||
// It must be kept in sync with the enumeration of values in
|
||||
// TypedObjectConstants.h; in particular we need to ensure that Count is
|
||||
|
@ -1133,7 +1135,7 @@ template<typename V>
|
|||
MOZ_MUST_USE bool ToSimdConstant(JSContext* cx, HandleValue v, jit::SimdConstant* out);
|
||||
|
||||
JSObject*
|
||||
InitSimdClass(JSContext* cx, HandleObject obj);
|
||||
InitSimdClass(JSContext* cx, Handle<GlobalObject*> global);
|
||||
|
||||
namespace jit {
|
||||
|
||||
|
|
|
@ -3622,12 +3622,8 @@ StringObject::assignInitialShape(JSContext* cx, Handle<StringObject*> obj)
|
|||
}
|
||||
|
||||
JSObject*
|
||||
js::InitStringClass(JSContext* cx, HandleObject obj)
|
||||
js::InitStringClass(JSContext* cx, Handle<GlobalObject*> global)
|
||||
{
|
||||
MOZ_ASSERT(obj->isNative());
|
||||
|
||||
Handle<GlobalObject*> global = obj.as<GlobalObject>();
|
||||
|
||||
Rooted<JSString*> empty(cx, cx->runtime()->emptyString);
|
||||
Rooted<StringObject*> proto(cx, GlobalObject::createBlankPrototype<StringObject>(cx, global));
|
||||
if (!proto)
|
||||
|
|
|
@ -24,9 +24,11 @@
|
|||
|
||||
namespace js {
|
||||
|
||||
class GlobalObject;
|
||||
|
||||
/* Initialize the String class, returning its prototype object. */
|
||||
extern JSObject*
|
||||
InitStringClass(JSContext* cx, HandleObject obj);
|
||||
InitStringClass(JSContext* cx, Handle<GlobalObject*> global);
|
||||
|
||||
extern bool
|
||||
str_fromCharCode(JSContext* cx, unsigned argc, Value* vp);
|
||||
|
|
|
@ -48,10 +48,8 @@ const JSFunctionSpec SymbolObject::staticMethods[] = {
|
|||
};
|
||||
|
||||
JSObject*
|
||||
SymbolObject::initClass(JSContext* cx, HandleObject obj, bool defineMembers)
|
||||
SymbolObject::initClass(JSContext* cx, Handle<GlobalObject*> global, bool defineMembers)
|
||||
{
|
||||
Handle<GlobalObject*> global = obj.as<GlobalObject>();
|
||||
|
||||
// This uses &JSObject::class_ because: "The Symbol prototype object is an
|
||||
// ordinary object. It is not a Symbol instance and does not have a
|
||||
// [[SymbolData]] internal slot." (ES6 rev 24, 19.4.3)
|
||||
|
@ -234,13 +232,13 @@ SymbolObject::toPrimitive(JSContext* cx, unsigned argc, Value* vp)
|
|||
}
|
||||
|
||||
JSObject*
|
||||
js::InitSymbolClass(JSContext* cx, HandleObject obj)
|
||||
js::InitSymbolClass(JSContext* cx, Handle<GlobalObject*> global)
|
||||
{
|
||||
return SymbolObject::initClass(cx, obj, true);
|
||||
return SymbolObject::initClass(cx, global, true);
|
||||
}
|
||||
|
||||
JSObject*
|
||||
js::InitBareSymbolCtor(JSContext* cx, HandleObject obj)
|
||||
js::InitBareSymbolCtor(JSContext* cx, Handle<GlobalObject*> global)
|
||||
{
|
||||
return SymbolObject::initClass(cx, obj, false);
|
||||
return SymbolObject::initClass(cx, global, false);
|
||||
}
|
||||
|
|
|
@ -12,6 +12,8 @@
|
|||
|
||||
namespace js {
|
||||
|
||||
class GlobalObject;
|
||||
|
||||
class SymbolObject : public NativeObject
|
||||
{
|
||||
/* Stores this Symbol object's [[PrimitiveValue]]. */
|
||||
|
@ -22,7 +24,7 @@ class SymbolObject : public NativeObject
|
|||
|
||||
static const Class class_;
|
||||
|
||||
static JSObject* initClass(JSContext* cx, js::HandleObject obj, bool defineMembers);
|
||||
static JSObject* initClass(JSContext* cx, Handle<GlobalObject*> global, bool defineMembers);
|
||||
|
||||
/*
|
||||
* Creates a new Symbol object boxing the given primitive Symbol. The
|
||||
|
@ -58,10 +60,10 @@ class SymbolObject : public NativeObject
|
|||
};
|
||||
|
||||
extern JSObject*
|
||||
InitSymbolClass(JSContext* cx, HandleObject obj);
|
||||
InitSymbolClass(JSContext* cx, Handle<GlobalObject*> global);
|
||||
|
||||
extern JSObject*
|
||||
InitBareSymbolCtor(JSContext* cx, HandleObject obj);
|
||||
InitBareSymbolCtor(JSContext* cx, Handle<GlobalObject*> global);
|
||||
|
||||
} /* namespace js */
|
||||
|
||||
|
|
|
@ -1310,9 +1310,8 @@ GlobalObject::initTypedObjectModule(JSContext* cx, Handle<GlobalObject*> global)
|
|||
}
|
||||
|
||||
JSObject*
|
||||
js::InitTypedObjectModuleObject(JSContext* cx, HandleObject obj)
|
||||
js::InitTypedObjectModuleObject(JSContext* cx, Handle<GlobalObject*> global)
|
||||
{
|
||||
Handle<GlobalObject*> global = obj.as<GlobalObject>();
|
||||
return GlobalObject::getOrCreateTypedObjectModule(cx, global);
|
||||
}
|
||||
|
||||
|
|
|
@ -93,6 +93,8 @@
|
|||
|
||||
namespace js {
|
||||
|
||||
class GlobalObject;
|
||||
|
||||
/*
|
||||
* Helper method for converting a double into other scalar
|
||||
* types in the same way that JavaScript would. In particular,
|
||||
|
@ -1021,7 +1023,7 @@ TypedObject::opaque() const
|
|||
}
|
||||
|
||||
JSObject*
|
||||
InitTypedObjectModuleObject(JSContext* cx, JS::HandleObject obj);
|
||||
InitTypedObjectModuleObject(JSContext* cx, JS::Handle<GlobalObject*> global);
|
||||
|
||||
} // namespace js
|
||||
|
||||
|
|
|
@ -290,12 +290,8 @@ static const JSFunctionSpec weak_map_methods[] = {
|
|||
};
|
||||
|
||||
JSObject*
|
||||
js::InitWeakMapClass(JSContext* cx, HandleObject obj)
|
||||
js::InitWeakMapClass(JSContext* cx, Handle<GlobalObject*> global)
|
||||
{
|
||||
MOZ_ASSERT(obj->isNative());
|
||||
|
||||
Handle<GlobalObject*> global = obj.as<GlobalObject>();
|
||||
|
||||
RootedPlainObject proto(cx, NewBuiltinClassInstance<PlainObject>(cx));
|
||||
if (!proto)
|
||||
return nullptr;
|
||||
|
|
|
@ -12,6 +12,8 @@
|
|||
|
||||
namespace js {
|
||||
|
||||
class GlobalObject;
|
||||
|
||||
// Abstract base class for WeakMapObject and WeakSetObject.
|
||||
class WeakCollectionObject : public NativeObject
|
||||
{
|
||||
|
@ -33,7 +35,7 @@ class WeakMapObject : public WeakCollectionObject
|
|||
};
|
||||
|
||||
extern JSObject*
|
||||
InitWeakMapClass(JSContext* cx, HandleObject obj);
|
||||
InitWeakMapClass(JSContext* cx, Handle<GlobalObject*> global);
|
||||
|
||||
} // namespace js
|
||||
|
||||
|
|
|
@ -150,9 +150,8 @@ const JSFunctionSpec WeakSetObject::methods[] = {
|
|||
};
|
||||
|
||||
JSObject*
|
||||
WeakSetObject::initClass(JSContext* cx, HandleObject obj)
|
||||
WeakSetObject::initClass(JSContext* cx, Handle<GlobalObject*> global)
|
||||
{
|
||||
Handle<GlobalObject*> global = obj.as<GlobalObject>();
|
||||
RootedPlainObject proto(cx, NewBuiltinClassInstance<PlainObject>(cx));
|
||||
if (!proto)
|
||||
return nullptr;
|
||||
|
@ -238,9 +237,9 @@ WeakSetObject::construct(JSContext* cx, unsigned argc, Value* vp)
|
|||
|
||||
|
||||
JSObject*
|
||||
js::InitWeakSetClass(JSContext* cx, HandleObject obj)
|
||||
js::InitWeakSetClass(JSContext* cx, Handle<GlobalObject*> global)
|
||||
{
|
||||
return WeakSetObject::initClass(cx, obj);
|
||||
return WeakSetObject::initClass(cx, global);
|
||||
}
|
||||
|
||||
JS_FRIEND_API(bool)
|
||||
|
|
|
@ -11,10 +11,12 @@
|
|||
|
||||
namespace js {
|
||||
|
||||
class GlobalObject;
|
||||
|
||||
class WeakSetObject : public WeakCollectionObject
|
||||
{
|
||||
public:
|
||||
static JSObject* initClass(JSContext* cx, HandleObject obj);
|
||||
static JSObject* initClass(JSContext* cx, Handle<GlobalObject*> global);
|
||||
static const Class class_;
|
||||
|
||||
private:
|
||||
|
@ -28,7 +30,7 @@ class WeakSetObject : public WeakCollectionObject
|
|||
};
|
||||
|
||||
extern JSObject*
|
||||
InitWeakSetClass(JSContext* cx, HandleObject obj);
|
||||
InitWeakSetClass(JSContext* cx, Handle<GlobalObject*> global);
|
||||
|
||||
} // namespace js
|
||||
|
||||
|
|
|
@ -568,9 +568,8 @@ GlobalObject::initIntlObject(JSContext* cx, Handle<GlobalObject*> global)
|
|||
}
|
||||
|
||||
JSObject*
|
||||
js::InitIntlClass(JSContext* cx, HandleObject obj)
|
||||
js::InitIntlClass(JSContext* cx, Handle<GlobalObject*> global)
|
||||
{
|
||||
Handle<GlobalObject*> global = obj.as<GlobalObject>();
|
||||
if (!GlobalObject::initIntlObject(cx, global))
|
||||
return nullptr;
|
||||
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
namespace js {
|
||||
|
||||
struct Class;
|
||||
class GlobalObject;
|
||||
|
||||
extern const Class IntlClass;
|
||||
|
||||
|
@ -23,7 +24,7 @@ extern const Class IntlClass;
|
|||
* Spec: ECMAScript Internationalization API Specification, 8.0, 8.1
|
||||
*/
|
||||
extern JSObject*
|
||||
InitIntlClass(JSContext* cx, JS::Handle<JSObject*> obj);
|
||||
InitIntlClass(JSContext* cx, JS::Handle<GlobalObject*> global);
|
||||
|
||||
/**
|
||||
* Returns a plain object with calendar information for a single valid locale
|
||||
|
|
|
@ -1476,9 +1476,8 @@ static const JSFunctionSpec math_static_methods[] = {
|
|||
};
|
||||
|
||||
JSObject*
|
||||
js::InitMathClass(JSContext* cx, HandleObject obj)
|
||||
js::InitMathClass(JSContext* cx, Handle<GlobalObject*> global)
|
||||
{
|
||||
Handle<GlobalObject*> global = obj.as<GlobalObject>();
|
||||
RootedObject proto(cx, GlobalObject::getOrCreateObjectPrototype(cx, global));
|
||||
if (!proto)
|
||||
return nullptr;
|
||||
|
@ -1486,7 +1485,7 @@ js::InitMathClass(JSContext* cx, HandleObject obj)
|
|||
if (!Math)
|
||||
return nullptr;
|
||||
|
||||
if (!JS_DefineProperty(cx, obj, js_Math_str, Math, JSPROP_RESOLVING))
|
||||
if (!JS_DefineProperty(cx, global, js_Math_str, Math, JSPROP_RESOLVING))
|
||||
return nullptr;
|
||||
if (!JS_DefineFunctions(cx, Math, math_static_methods))
|
||||
return nullptr;
|
||||
|
@ -1495,7 +1494,7 @@ js::InitMathClass(JSContext* cx, HandleObject obj)
|
|||
if (!DefineToStringTag(cx, Math, cx->names().Math))
|
||||
return nullptr;
|
||||
|
||||
obj->as<GlobalObject>().setConstructor(JSProto_Math, ObjectValue(*Math));
|
||||
global->setConstructor(JSProto_Math, ObjectValue(*Math));
|
||||
|
||||
return Math;
|
||||
}
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
namespace js {
|
||||
|
||||
struct Class;
|
||||
class GlobalObject;
|
||||
|
||||
typedef double (*UnaryFunType)(double);
|
||||
|
||||
|
@ -89,7 +90,7 @@ class MathCache
|
|||
extern const Class MathClass;
|
||||
|
||||
extern JSObject*
|
||||
InitMathClass(JSContext* cx, HandleObject obj);
|
||||
InitMathClass(JSContext* cx, Handle<GlobalObject*> global);
|
||||
|
||||
extern uint64_t
|
||||
GenerateRandomSeed();
|
||||
|
|
|
@ -1194,12 +1194,8 @@ js::FinishRuntimeNumberState(JSRuntime* rt)
|
|||
#endif
|
||||
|
||||
JSObject*
|
||||
js::InitNumberClass(JSContext* cx, HandleObject obj)
|
||||
js::InitNumberClass(JSContext* cx, Handle<GlobalObject*> global)
|
||||
{
|
||||
MOZ_ASSERT(obj->isNative());
|
||||
|
||||
Handle<GlobalObject*> global = obj.as<GlobalObject>();
|
||||
|
||||
Rooted<NumberObject*> numberProto(cx);
|
||||
numberProto = GlobalObject::createBlankPrototype<NumberObject>(cx, global);
|
||||
if (!numberProto)
|
||||
|
|
|
@ -34,6 +34,7 @@
|
|||
|
||||
namespace js {
|
||||
|
||||
class GlobalObject;
|
||||
class StringBuffer;
|
||||
|
||||
extern MOZ_MUST_USE bool
|
||||
|
@ -46,7 +47,7 @@ FinishRuntimeNumberState(JSRuntime* rt);
|
|||
|
||||
/* Initialize the Number class, returning its prototype object. */
|
||||
extern JSObject*
|
||||
InitNumberClass(JSContext* cx, HandleObject obj);
|
||||
InitNumberClass(JSContext* cx, Handle<GlobalObject*> global);
|
||||
|
||||
/*
|
||||
* When base == 10, this function implements ToString() as specified by
|
||||
|
|
|
@ -843,15 +843,14 @@ ProxyObject::renew(const BaseProxyHandler* handler, const Value& priv)
|
|||
setReservedSlot(i, UndefinedValue());
|
||||
}
|
||||
|
||||
JS_FRIEND_API(JSObject*)
|
||||
js::InitProxyClass(JSContext* cx, HandleObject obj)
|
||||
JSObject*
|
||||
js::InitProxyClass(JSContext* cx, Handle<GlobalObject*> global)
|
||||
{
|
||||
static const JSFunctionSpec static_methods[] = {
|
||||
JS_FN("revocable", proxy_revocable, 2, 0),
|
||||
JS_FS_END
|
||||
};
|
||||
|
||||
Handle<GlobalObject*> global = obj.as<GlobalObject>();
|
||||
RootedFunction ctor(cx);
|
||||
ctor = GlobalObject::createConstructor(cx, proxy, cx->names().Proxy, 2);
|
||||
if (!ctor)
|
||||
|
@ -859,7 +858,7 @@ js::InitProxyClass(JSContext* cx, HandleObject obj)
|
|||
|
||||
if (!JS_DefineFunctions(cx, ctor, static_methods))
|
||||
return nullptr;
|
||||
if (!JS_DefineProperty(cx, obj, "Proxy", ctor, JSPROP_RESOLVING))
|
||||
if (!JS_DefineProperty(cx, global, "Proxy", ctor, JSPROP_RESOLVING))
|
||||
return nullptr;
|
||||
|
||||
global->setConstructor(JSProto_Proxy, ObjectValue(*ctor));
|
||||
|
|
|
@ -13,6 +13,8 @@
|
|||
|
||||
namespace js {
|
||||
|
||||
class GlobalObject;
|
||||
|
||||
/*
|
||||
* Dispatch point for handlers that executes the appropriate C++ or scripted traps.
|
||||
*
|
||||
|
@ -102,6 +104,9 @@ bool
|
|||
ProxySetPropertyByValue(JSContext* cx, HandleObject proxy, HandleValue idVal, HandleValue val,
|
||||
bool strict);
|
||||
|
||||
extern JSObject*
|
||||
InitProxyClass(JSContext* cx, Handle<GlobalObject*> global);
|
||||
|
||||
} /* namespace js */
|
||||
|
||||
#endif /* proxy_Proxy_h */
|
||||
|
|
|
@ -13,6 +13,8 @@
|
|||
|
||||
namespace js {
|
||||
|
||||
class GlobalObject;
|
||||
|
||||
class BooleanObject : public NativeObject
|
||||
{
|
||||
/* Stores this Boolean object's [[PrimitiveValue]]. */
|
||||
|
@ -41,7 +43,7 @@ class BooleanObject : public NativeObject
|
|||
|
||||
/* For access to init, as Boolean.prototype is special. */
|
||||
friend JSObject*
|
||||
js::InitBooleanClass(JSContext* cx, js::HandleObject global);
|
||||
js::InitBooleanClass(JSContext* cx, js::Handle<GlobalObject*> global);
|
||||
};
|
||||
|
||||
} // namespace js
|
||||
|
|
|
@ -54,14 +54,14 @@ extern const Class MathClass;
|
|||
extern const Class WebAssemblyClass;
|
||||
|
||||
#define DECLARE_PROTOTYPE_CLASS_INIT(name,init,clasp) \
|
||||
extern JSObject* init(JSContext* cx, Handle<JSObject*> obj);
|
||||
extern JSObject* init(JSContext* cx, Handle<GlobalObject*> global);
|
||||
JS_FOR_EACH_PROTOTYPE(DECLARE_PROTOTYPE_CLASS_INIT)
|
||||
#undef DECLARE_PROTOTYPE_CLASS_INIT
|
||||
|
||||
} // namespace js
|
||||
|
||||
JSObject*
|
||||
js::InitViaClassSpec(JSContext* cx, Handle<JSObject*> obj)
|
||||
js::InitViaClassSpec(JSContext* cx, Handle<GlobalObject*> global)
|
||||
{
|
||||
MOZ_CRASH("InitViaClassSpec() should not be called.");
|
||||
}
|
||||
|
|
|
@ -1025,7 +1025,7 @@ GetThisValueOfWith(JSObject* env);
|
|||
|
||||
/* * */
|
||||
|
||||
typedef JSObject* (*ClassInitializerOp)(JSContext* cx, JS::HandleObject obj);
|
||||
using ClassInitializerOp = JSObject* (*)(JSContext* cx, Handle<GlobalObject*> global);
|
||||
|
||||
} /* namespace js */
|
||||
|
||||
|
|
|
@ -11,6 +11,8 @@
|
|||
|
||||
namespace js {
|
||||
|
||||
class GlobalObject;
|
||||
|
||||
class NumberObject : public NativeObject
|
||||
{
|
||||
/* Stores this Number object's [[PrimitiveValue]]. */
|
||||
|
@ -39,7 +41,7 @@ class NumberObject : public NativeObject
|
|||
|
||||
/* For access to init, as Number.prototype is special. */
|
||||
friend JSObject*
|
||||
js::InitNumberClass(JSContext* cx, HandleObject global);
|
||||
js::InitNumberClass(JSContext* cx, Handle<GlobalObject*> global);
|
||||
};
|
||||
|
||||
} // namespace js
|
||||
|
|
|
@ -14,6 +14,8 @@
|
|||
|
||||
namespace js {
|
||||
|
||||
class GlobalObject;
|
||||
|
||||
class StringObject : public NativeObject
|
||||
{
|
||||
static const unsigned PRIMITIVE_VALUE_SLOT = 0;
|
||||
|
@ -66,7 +68,7 @@ class StringObject : public NativeObject
|
|||
|
||||
/* For access to init, as String.prototype is special. */
|
||||
friend JSObject*
|
||||
js::InitStringClass(JSContext* cx, HandleObject global);
|
||||
js::InitStringClass(JSContext* cx, Handle<GlobalObject*> global);
|
||||
};
|
||||
|
||||
} // namespace js
|
||||
|
|
|
@ -3128,11 +3128,10 @@ InitErrorClass(JSContext* cx, HandleObject wasm, const char* name, JSExnType exn
|
|||
}
|
||||
|
||||
JSObject*
|
||||
js::InitWebAssemblyClass(JSContext* cx, HandleObject obj)
|
||||
js::InitWebAssemblyClass(JSContext* cx, Handle<GlobalObject*> global)
|
||||
{
|
||||
MOZ_RELEASE_ASSERT(HasSupport(cx));
|
||||
|
||||
Handle<GlobalObject*> global = obj.as<GlobalObject>();
|
||||
MOZ_ASSERT(!global->isStandardClassResolved(JSProto_WebAssembly));
|
||||
|
||||
RootedObject proto(cx, GlobalObject::getOrCreateObjectPrototype(cx, global));
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
|
||||
namespace js {
|
||||
|
||||
class GlobalObject;
|
||||
class TypedArrayObject;
|
||||
class WasmFunctionScope;
|
||||
class WasmInstanceScope;
|
||||
|
@ -90,7 +91,7 @@ IsSharedWasmMemoryObject(JSObject* obj);
|
|||
extern const Class WebAssemblyClass;
|
||||
|
||||
JSObject*
|
||||
InitWebAssemblyClass(JSContext* cx, HandleObject global);
|
||||
InitWebAssemblyClass(JSContext* cx, Handle<GlobalObject*> global);
|
||||
|
||||
// The class of WebAssembly.Module. Each WasmModuleObject owns a
|
||||
// wasm::Module. These objects are used both as content-facing JS objects and as
|
||||
|
|
Загрузка…
Ссылка в новой задаче