Bug 1103368, part 4 - Ban stub getter/setter arguments to js::CheckDefineProperty. r=bhackett.
This commit is contained in:
@@ -532,8 +532,7 @@ JavaScriptShared::findObjectById(JSContext *cx, const ObjectId &objId)
|
||||
return obj;
|
||||
}
|
||||
|
||||
static const uint64_t DefaultPropertyOp = 1;
|
||||
static const uint64_t UnknownPropertyOp = 2;
|
||||
static const uint64_t UnknownPropertyOp = 1;
|
||||
|
||||
bool
|
||||
JavaScriptShared::fromDescriptor(JSContext *cx, Handle<JSPropertyDescriptor> desc,
|
||||
@@ -556,7 +555,7 @@ JavaScriptShared::fromDescriptor(JSContext *cx, Handle<JSPropertyDescriptor> des
|
||||
out->getter() = objVar;
|
||||
} else {
|
||||
if (desc.getter() == JS_PropertyStub)
|
||||
out->getter() = DefaultPropertyOp;
|
||||
out->getter() = 0;
|
||||
else
|
||||
out->getter() = UnknownPropertyOp;
|
||||
}
|
||||
@@ -571,7 +570,7 @@ JavaScriptShared::fromDescriptor(JSContext *cx, Handle<JSPropertyDescriptor> des
|
||||
out->setter() = objVar;
|
||||
} else {
|
||||
if (desc.setter() == JS_StrictPropertyStub)
|
||||
out->setter() = DefaultPropertyOp;
|
||||
out->setter() = 0;
|
||||
else
|
||||
out->setter() = UnknownPropertyOp;
|
||||
}
|
||||
@@ -611,10 +610,7 @@ JavaScriptShared::toDescriptor(JSContext *cx, const PPropertyDescriptor &in,
|
||||
return false;
|
||||
out.setGetter(JS_DATA_TO_FUNC_PTR(JSPropertyOp, getter.get()));
|
||||
} else {
|
||||
if (in.getter().get_uint64_t() == DefaultPropertyOp)
|
||||
out.setGetter(JS_PropertyStub);
|
||||
else
|
||||
out.setGetter(UnknownPropertyStub);
|
||||
out.setGetter(UnknownPropertyStub);
|
||||
}
|
||||
|
||||
if (in.setter().type() == GetterSetter::Tuint64_t && !in.setter().get_uint64_t()) {
|
||||
@@ -626,10 +622,7 @@ JavaScriptShared::toDescriptor(JSContext *cx, const PPropertyDescriptor &in,
|
||||
return false;
|
||||
out.setSetter(JS_DATA_TO_FUNC_PTR(JSStrictPropertyOp, setter.get()));
|
||||
} else {
|
||||
if (in.setter().get_uint64_t() == DefaultPropertyOp)
|
||||
out.setSetter(JS_StrictPropertyStub);
|
||||
else
|
||||
out.setSetter(UnknownStrictPropertyStub);
|
||||
out.setSetter(UnknownStrictPropertyStub);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user