This commit is contained in:
Ryan VanderMeulen 2013-07-29 16:07:59 -04:00
Родитель 7419be4db6 55c3667424
Коммит 7bd9efe0db
65 изменённых файлов: 284 добавлений и 223 удалений

Просмотреть файл

@ -85,7 +85,7 @@ nsSecurityNameSet::InitializeNameSet(nsIScriptContext* aScriptContext)
JSClass *objectClass = JS_GetClass(obj);
JS::Rooted<JS::Value> v(cx);
if (!JS_GetProperty(cx, global, "netscape", v.address()))
if (!JS_GetProperty(cx, global, "netscape", &v))
return NS_ERROR_FAILURE;
JS::Rooted<JSObject*> securityObj(cx);
@ -95,7 +95,7 @@ nsSecurityNameSet::InitializeNameSet(nsIScriptContext* aScriptContext)
* "security" property.
*/
obj = &v.toObject();
if (!JS_GetProperty(cx, obj, "security", v.address()) || !v.isObject())
if (!JS_GetProperty(cx, obj, "security", &v) || !v.isObject())
return NS_ERROR_FAILURE;
securityObj = &v.toObject();
} else {

Просмотреть файл

@ -748,8 +748,7 @@ nsFrameMessageManager::ReceiveMessage(nsISupports* aTarget,
thisValue.address(), nullptr, true);
} else {
// If the listener is a JS object which has receiveMessage function:
if (!JS_GetProperty(ctx, object, "receiveMessage",
funval.address()) ||
if (!JS_GetProperty(ctx, object, "receiveMessage", &funval) ||
!funval.isObject())
return NS_ERROR_UNEXPECTED;

Просмотреть файл

@ -1163,7 +1163,7 @@ nsXBLBinding::LookupMemberInternal(JSContext* aCx, nsString& aName,
// Find our class object. It's in a protected scope and permanent just in case,
// so should be there no matter what.
JS::RootedValue classObject(aCx);
if (!JS_GetProperty(aCx, aXBLScope, mJSClass->name, classObject.address())) {
if (!JS_GetProperty(aCx, aXBLScope, mJSClass->name, &classObject)) {
return false;
}

Просмотреть файл

@ -244,7 +244,7 @@ FieldGetterImpl(JSContext *cx, JS::CallArgs args)
}
JS::Rooted<JS::Value> v(cx);
if (!JS_GetPropertyById(cx, thisObj, id, v.address())) {
if (!JS_GetPropertyById(cx, thisObj, id, &v)) {
return false;
}
args.rval().set(v);

Просмотреть файл

@ -541,7 +541,7 @@ AudioChannelService::Observe(nsISupports* aSubject, const char* aTopic, const PR
JS::Rooted<JSObject*> obj(cx, &val.toObject());
JS::Rooted<JS::Value> key(cx);
if (!JS_GetProperty(cx, obj, "key", key.address()) ||
if (!JS_GetProperty(cx, obj, "key", &key) ||
!key.isString()) {
return NS_OK;
}
@ -556,7 +556,7 @@ AudioChannelService::Observe(nsISupports* aSubject, const char* aTopic, const PR
}
JS::Rooted<JS::Value> value(cx);
if (!JS_GetProperty(cx, obj, "value", value.address()) || !value.isInt32()) {
if (!JS_GetProperty(cx, obj, "value", &value) || !value.isInt32()) {
return NS_OK;
}

Просмотреть файл

@ -478,15 +478,15 @@ static nsDOMClassInfoData sClassInfoData[] = {
NS_DEFINE_CLASSINFO_DATA(XULCommandDispatcher, nsDOMGenericSH,
DOM_DEFAULT_SCRIPTABLE_FLAGS)
#endif
NS_DEFINE_CLASSINFO_DATA(XULControllers, nsNonDOMObjectSH,
DEFAULT_SCRIPTABLE_FLAGS)
NS_DEFINE_CLASSINFO_DATA(BoxObject, nsDOMGenericSH,
DEFAULT_SCRIPTABLE_FLAGS)
NS_DEFINE_CHROME_ONLY_CLASSINFO_DATA(XULControllers, nsNonDOMObjectSH,
DEFAULT_SCRIPTABLE_FLAGS)
NS_DEFINE_CHROME_ONLY_CLASSINFO_DATA(BoxObject, nsDOMGenericSH,
DEFAULT_SCRIPTABLE_FLAGS)
#ifdef MOZ_XUL
NS_DEFINE_CLASSINFO_DATA(TreeSelection, nsDOMGenericSH,
DEFAULT_SCRIPTABLE_FLAGS)
NS_DEFINE_CLASSINFO_DATA(TreeContentView, nsDOMGenericSH,
DEFAULT_SCRIPTABLE_FLAGS)
NS_DEFINE_CHROME_ONLY_CLASSINFO_DATA(TreeSelection, nsDOMGenericSH,
DEFAULT_SCRIPTABLE_FLAGS)
NS_DEFINE_CHROME_ONLY_CLASSINFO_DATA(TreeContentView, nsDOMGenericSH,
DEFAULT_SCRIPTABLE_FLAGS)
#endif
// Crypto classes
@ -503,19 +503,19 @@ static nsDOMClassInfoData sClassInfoData[] = {
WINDOW_SCRIPTABLE_FLAGS)
#ifdef MOZ_XUL
NS_DEFINE_CLASSINFO_DATA(XULTemplateBuilder, nsDOMGenericSH,
DEFAULT_SCRIPTABLE_FLAGS)
NS_DEFINE_CHROME_ONLY_CLASSINFO_DATA(XULTemplateBuilder, nsDOMGenericSH,
DEFAULT_SCRIPTABLE_FLAGS)
NS_DEFINE_CLASSINFO_DATA(XULTreeBuilder, nsDOMGenericSH,
DEFAULT_SCRIPTABLE_FLAGS)
NS_DEFINE_CHROME_ONLY_CLASSINFO_DATA(XULTreeBuilder, nsDOMGenericSH,
DEFAULT_SCRIPTABLE_FLAGS)
#endif
NS_DEFINE_CLASSINFO_DATA(DOMStringList, nsStringListSH,
ARRAY_SCRIPTABLE_FLAGS)
#ifdef MOZ_XUL
NS_DEFINE_CLASSINFO_DATA(TreeColumn, nsDOMGenericSH,
DEFAULT_SCRIPTABLE_FLAGS)
NS_DEFINE_CHROME_ONLY_CLASSINFO_DATA(TreeColumn, nsDOMGenericSH,
DEFAULT_SCRIPTABLE_FLAGS)
#endif
NS_DEFINE_CLASSINFO_DATA(CSSMozDocumentRule, nsDOMGenericSH,
@ -2713,7 +2713,7 @@ BaseStubConstructor(nsIWeakReference* aWeakOwner,
JSAutoCompartment ac(cx, thisObject);
JS::Rooted<JS::Value> funval(cx);
if (!JS_GetProperty(cx, thisObject, "constructor", funval.address()) ||
if (!JS_GetProperty(cx, thisObject, "constructor", &funval) ||
!funval.isObject()) {
return NS_ERROR_UNEXPECTED;
}
@ -3218,7 +3218,7 @@ nsDOMConstructor::HasInstance(nsIXPConnectWrappedNative *wrapper,
// This isn't a normal DOM object, see if this constructor lives on its
// prototype chain.
JS::Rooted<JS::Value> val(cx);
if (!JS_GetProperty(cx, obj, "prototype", val.address())) {
if (!JS_GetProperty(cx, obj, "prototype", &val)) {
return NS_ERROR_UNEXPECTED;
}
@ -3959,7 +3959,10 @@ ContentWindowGetter(JSContext *cx, unsigned argc, jsval *vp)
if (!obj)
return JS_FALSE;
return ::JS_GetProperty(cx, obj, "content", vp);
JS::Rooted<JS::Value> value(cx);
bool result = ::JS_GetProperty(cx, obj, "content", &value);
*vp = value;
return result;
}
template<class Interface>
@ -4106,7 +4109,7 @@ DefineComponentsShim(JSContext *cx, JS::HandleObject global)
// Look up the appopriate interface object on the global.
JS::Rooted<JS::Value> v(cx, JS::UndefinedValue());
ok = JS_GetProperty(cx, global, domName, v.address());
ok = JS_GetProperty(cx, global, domName, &v);
NS_ENSURE_TRUE(ok, NS_ERROR_OUT_OF_MEMORY);
if (!v.isObject()) {
NS_WARNING("Unable to find interface object on global");
@ -4637,7 +4640,7 @@ nsGenericArraySH::GetLength(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
*length = 0;
JS::Rooted<JS::Value> lenval(cx);
if (!JS_GetProperty(cx, obj, "length", lenval.address())) {
if (!JS_GetProperty(cx, obj, "length", &lenval)) {
return NS_ERROR_UNEXPECTED;
}
@ -4676,7 +4679,7 @@ nsGenericArraySH::Enumerate(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
sCurrentlyEnumerating = true;
JS::Rooted<JS::Value> len_val(cx);
JSBool ok = ::JS_GetProperty(cx, obj, "length", len_val.address());
JSBool ok = ::JS_GetProperty(cx, obj, "length", &len_val);
if (ok && JSVAL_IS_INT(len_val)) {
int32_t length = JSVAL_TO_INT(len_val);
@ -5024,7 +5027,13 @@ nsHTMLDocumentSH::CallToGetPropMapper(JSContext *cx, unsigned argc, jsval *vp)
return JS_FALSE;
}
return ::JS_GetUCProperty(cx, self, chars, length, vp);
JS::Rooted<JS::Value> value(cx);
if (!::JS_GetUCProperty(cx, self, chars, length, &value)) {
return false;
}
*vp = value;
return true;
}
// StringArray helper

Просмотреть файл

@ -1322,7 +1322,13 @@ GetPropertyOnPrototype(JSContext* cx, JS::Handle<JSObject*> proxy,
return true;
}
return JS_ForwardGetPropertyTo(cx, proto, id, proxy, vp);
JS::Rooted<JS::Value> value(cx);
if (!JS_ForwardGetPropertyTo(cx, proto, id, proxy, &value)) {
return false;
}
*vp = value;
return true;
}
bool
@ -1741,7 +1747,7 @@ InterfaceHasInstance(JSContext* cx, JS::Handle<JSObject*> obj,
}
JS::Rooted<JS::Value> protov(cx);
DebugOnly<bool> ok = JS_GetProperty(cx, obj, "prototype", protov.address());
DebugOnly<bool> ok = JS_GetProperty(cx, obj, "prototype", &protov);
MOZ_ASSERT(ok, "Someone messed with our prototype property?");
JS::Rooted<JSObject*> interfacePrototype(cx, &protov.toObject());
@ -1845,7 +1851,7 @@ GetWindowForJSImplementedObject(JSContext* cx, JS::Handle<JSObject*> obj,
// Look up the content-side object.
JS::Rooted<JS::Value> domImplVal(cx);
if (!JS_GetProperty(cx, obj, "__DOM_IMPL__", domImplVal.address())) {
if (!JS_GetProperty(cx, obj, "__DOM_IMPL__", &domImplVal)) {
return false;
}

Просмотреть файл

@ -16,7 +16,7 @@ bool
CallbackInterface::GetCallableProperty(JSContext* cx, const char* aPropName,
JS::MutableHandle<JS::Value> aCallable)
{
if (!JS_GetProperty(cx, mCallback, aPropName, aCallable.address())) {
if (!JS_GetProperty(cx, mCallback, aPropName, aCallable)) {
return false;
}
if (!aCallable.isObject() ||

Просмотреть файл

@ -5527,7 +5527,7 @@ class CGSpecializedForwardingSetter(CGSpecializedSetter):
assert all(ord(c) < 128 for c in attrName)
assert all(ord(c) < 128 for c in forwardToAttrName)
return CGIndenter(CGGeneric("""JS::RootedValue v(cx);
if (!JS_GetProperty(cx, obj, "%s", v.address())) {
if (!JS_GetProperty(cx, obj, "%s", &v)) {
return false;
}
@ -7541,7 +7541,7 @@ class CGDOMJSProxyHandler_get(ClassMethod):
" return false;\n"
"}\n"
"if (hasUnforgeable) {\n"
" return JS_ForwardGetPropertyTo(cx, ${holder}, id, proxy, vp.address());\n"
" return JS_ForwardGetPropertyTo(cx, ${holder}, id, proxy, vp);\n"
"}")
getUnforgeableOrExpando = CallOnUnforgeableHolder(self.descriptor,
hasUnforgeable)
@ -7555,7 +7555,7 @@ if (expando) {
}
if (hasProp) {
return JS_GetPropertyById(cx, expando, id, vp.address());
return JS_GetPropertyById(cx, expando, id, vp);
}
}"""
@ -8216,11 +8216,11 @@ class CGDictionary(CGThing):
# NOTE: jsids are per-runtime, so don't use them in workers
if self.workers:
propName = member.identifier.name
propGet = ('JS_GetProperty(cx, &val.toObject(), "%s", temp.ref().address())' %
propGet = ('JS_GetProperty(cx, &val.toObject(), "%s", &temp.ref())' %
propName)
else:
propId = self.makeIdName(member.identifier.name);
propGet = ("JS_GetPropertyById(cx, &val.toObject(), %s, temp.ref().address())" %
propGet = ("JS_GetPropertyById(cx, &val.toObject(), %s, &temp.ref())" %
propId)
conversionReplacements = {
@ -10120,7 +10120,7 @@ class CallbackGetter(CallbackMember):
"attrName": self.attrName
}
return string.Template(
'if (!JS_GetProperty(cx, mCallback, "${attrName}", rval.address())) {\n'
'if (!JS_GetProperty(cx, mCallback, "${attrName}", &rval)) {\n'
' aRv.Throw(NS_ERROR_UNEXPECTED);\n'
' return${errorReturn};\n'
'}\n').substitute(replacements);

Просмотреть файл

@ -537,7 +537,7 @@ BluetoothHfpManager::HandleVolumeChanged(const nsAString& aData)
JS::Rooted<JSObject*> obj(cx, &val.toObject());
JS::Rooted<JS::Value> key(cx);
if (!JS_GetProperty(cx, obj, "key", key.address()) || !key.isString()) {
if (!JS_GetProperty(cx, obj, "key", &key) || !key.isString()) {
return;
}
@ -548,7 +548,7 @@ BluetoothHfpManager::HandleVolumeChanged(const nsAString& aData)
}
JS::Rooted<JS::Value> value(cx);
if (!JS_GetProperty(cx, obj, "value", value.address())||
if (!JS_GetProperty(cx, obj, "value", &value)||
!value.isNumber()) {
return;
}

Просмотреть файл

@ -566,7 +566,7 @@ BluetoothService::HandleSettingsChanged(const nsAString& aData)
JSObject& obj(val.toObject());
JS::Value key;
JS::Rooted<JS::Value> key(cx);
if (!JS_GetProperty(cx, &obj, "key", &key)) {
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return NS_ERROR_OUT_OF_MEMORY;
@ -584,7 +584,7 @@ BluetoothService::HandleSettingsChanged(const nsAString& aData)
}
if (match) {
JS::Value value;
JS::Rooted<JS::Value> value(cx);
if (!JS_GetProperty(cx, &obj, "value", &value)) {
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return NS_ERROR_OUT_OF_MEMORY;
@ -607,7 +607,7 @@ BluetoothService::HandleSettingsChanged(const nsAString& aData)
}
if (match) {
JS::Value value;
JS::Rooted<JS::Value> value(cx);
if (!JS_GetProperty(cx, &obj, "value", &value)) {
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return NS_ERROR_OUT_OF_MEMORY;

Просмотреть файл

@ -39,7 +39,7 @@ MediaMetaData::Init(JSContext* aCx, const jsval* aVal)
pusher.Push(aCx);
JSAutoCompartment ac(aCx, obj);
JS::Value value;
JS::Rooted<JS::Value> value(aCx);
NS_ENSURE_STATE(JS_GetProperty(aCx, obj, "mAlbum", &value));
if (JSVAL_IS_STRING(value)) {
nsDependentJSString jsString;

Просмотреть файл

@ -38,7 +38,7 @@ MediaPlayStatus::Init(JSContext* aCx, const jsval* aVal)
pusher.Push(aCx);
JSAutoCompartment ac(aCx, obj);
JS::Value value;
JS::Rooted<JS::Value> value(aCx);
NS_ENSURE_STATE(JS_GetProperty(aCx, obj, "mDuration", &value));
if (JSVAL_IS_INT(value)) {
NS_ENSURE_STATE(JS_ValueToInt64(aCx, value, &mDuration));

Просмотреть файл

@ -117,8 +117,7 @@ GetJSValFromKeyPathString(JSContext* aCx,
if (hasProp) {
// Get if the property exists...
JS::Rooted<JS::Value> intermediate(aCx);
JSBool ok = JS_GetUCProperty(aCx, obj, keyPathChars, keyPathLen,
intermediate.address());
JSBool ok = JS_GetUCProperty(aCx, obj, keyPathChars, keyPathLen, &intermediate);
NS_ENSURE_TRUE(ok, NS_ERROR_DOM_INDEXEDDB_UNKNOWN_ERR);
// Treat explicitly undefined as an error.

Просмотреть файл

@ -213,7 +213,7 @@ TCPSocketParent::SendCallback(const nsAString& aType, const JS::Value& aDataVal,
nsDependentJSString name;
JS::Rooted<JS::Value> val(aCx);
if (!JS_GetProperty(aCx, obj, "name", val.address())) {
if (!JS_GetProperty(aCx, obj, "name", &val)) {
NS_ERROR("No name property on supposed error object");
} else if (JSVAL_IS_STRING(val)) {
if (!name.init(aCx, JSVAL_TO_STRING(val))) {

Просмотреть файл

@ -540,7 +540,7 @@ nsJSObjWrapper::NP_Invalidate(NPObject *npobj)
}
static JSBool
GetProperty(JSContext *cx, JSObject *obj, NPIdentifier id, JS::Value *rval)
GetProperty(JSContext *cx, JSObject *obj, NPIdentifier id, JS::MutableHandle<JS::Value> rval)
{
NS_ASSERTION(NPIdentifierIsInt(id) || NPIdentifierIsString(id),
"id must be either string or int!\n");
@ -574,7 +574,7 @@ nsJSObjWrapper::NP_HasMethod(NPObject *npobj, NPIdentifier id)
AutoJSExceptionReporter reporter(cx);
JS::Rooted<JS::Value> v(cx);
JSBool ok = GetProperty(cx, npjsobj->mJSObj, id, v.address());
JSBool ok = GetProperty(cx, npjsobj->mJSObj, id, &v);
return ok && !JSVAL_IS_PRIMITIVE(v) &&
::JS_ObjectIsFunction(cx, JSVAL_TO_OBJECT(v));
@ -610,7 +610,7 @@ doInvoke(NPObject *npobj, NPIdentifier method, const NPVariant *args,
AutoJSExceptionReporter reporter(cx);
if (method != NPIdentifier_VOID) {
if (!GetProperty(cx, npjsobj->mJSObj, method, fv.address()) ||
if (!GetProperty(cx, npjsobj->mJSObj, method, &fv) ||
::JS_TypeOfValue(cx, fv) != JSTYPE_FUNCTION) {
return false;
}
@ -752,7 +752,7 @@ nsJSObjWrapper::NP_GetProperty(NPObject *npobj, NPIdentifier id,
JSAutoCompartment ac(cx, npjsobj->mJSObj);
JS::Rooted<JS::Value> v(cx);
return (GetProperty(cx, npjsobj->mJSObj, id, v.address()) &&
return (GetProperty(cx, npjsobj->mJSObj, id, &v) &&
JSValToNPVariant(npp, cx, v, result));
}
@ -1621,7 +1621,7 @@ NPObjWrapper_Convert(JSContext *cx, JS::Handle<JSObject*> obj, JSType hint, JS::
// giving plugins a [[DefaultValue]] which uses only toString and not valueOf.
JS::Rooted<JS::Value> v(cx, JSVAL_VOID);
if (!JS_GetProperty(cx, obj, "toString", v.address()))
if (!JS_GetProperty(cx, obj, "toString", &v))
return false;
if (!JSVAL_IS_PRIMITIVE(v) && JS_ObjectIsCallable(cx, JSVAL_TO_OBJECT(v))) {
if (!JS_CallFunctionValue(cx, obj, v, 0, NULL, vp.address()))

Просмотреть файл

@ -718,7 +718,7 @@ nsGeolocationService::HandleMozsettingChanged(const PRUnichar* aData)
JS::Rooted<JSObject*> obj(cx, &val.toObject());
JS::Rooted<JS::Value> key(cx);
if (!JS_GetProperty(cx, obj, "key", key.address()) || !key.isString()) {
if (!JS_GetProperty(cx, obj, "key", &key) || !key.isString()) {
return;
}
@ -728,7 +728,7 @@ nsGeolocationService::HandleMozsettingChanged(const PRUnichar* aData)
}
JS::Rooted<JS::Value> value(cx);
if (!JS_GetProperty(cx, obj, "value", value.address()) || !value.isBoolean()) {
if (!JS_GetProperty(cx, obj, "value", &value) || !value.isBoolean()) {
return;
}

Просмотреть файл

@ -211,7 +211,7 @@ nsJSON::EncodeInternal(JSContext* cx, const JS::Value& aValue,
*/
JS::Rooted<JS::Value> val(cx, aValue);
JS::Rooted<JS::Value> toJSON(cx);
if (JS_GetProperty(cx, obj, "toJSON", toJSON.address()) &&
if (JS_GetProperty(cx, obj, "toJSON", &toJSON) &&
toJSON.isObject() &&
JS_ObjectIsCallable(cx, &toJSON.toObject())) {
// If toJSON is implemented, it must not throw

Просмотреть файл

@ -605,7 +605,7 @@ JSObject *GetOrCreateObjectProperty(JSContext *cx, JS::Handle<JSObject*> aObject
const char *aProperty)
{
JS::Rooted<JS::Value> val(cx);
if (!JS_GetProperty(cx, aObject, aProperty, val.address())) {
if (!JS_GetProperty(cx, aObject, aProperty, &val)) {
return NULL;
}
if (!val.isUndefined()) {

Просмотреть файл

@ -219,7 +219,7 @@ AudioManager::Observe(nsISupports* aSubject,
AudioSystem::setParameters(0, cmd);
}
}
}
}
// To process the volume control on each audio channel according to
// change of settings
else if (!strcmp(aTopic, "mozsettings-changed")) {
@ -233,7 +233,7 @@ AudioManager::Observe(nsISupports* aSubject,
JS::Rooted<JSObject*> obj(cx, &val.toObject());
JS::Rooted<JS::Value> key(cx);
if (!JS_GetProperty(cx, obj, "key", key.address()) ||
if (!JS_GetProperty(cx, obj, "key", &key) ||
!key.isString()) {
return NS_OK;
}
@ -248,7 +248,7 @@ AudioManager::Observe(nsISupports* aSubject,
}
JS::Rooted<JS::Value> value(cx);
if (!JS_GetProperty(cx, obj, "value", value.address()) || !value.isInt32()) {
if (!JS_GetProperty(cx, obj, "value", &value) || !value.isInt32()) {
return NS_OK;
}

Просмотреть файл

@ -186,7 +186,7 @@ AutoMounterSetting::Observe(nsISupports* aSubject,
return NS_OK;
}
JSObject& obj(val.toObject());
JS::Value key;
JS::Rooted<JS::Value> key(cx);
if (!JS_GetProperty(cx, &obj, "key", &key) ||
!key.isString()) {
return NS_OK;
@ -198,7 +198,7 @@ AutoMounterSetting::Observe(nsISupports* aSubject,
return NS_OK;
}
JS::Value value;
JS::Rooted<JS::Value> value(cx);
if (!JS_GetProperty(cx, &obj, "value", &value)) {
return NS_OK;
}

Просмотреть файл

@ -180,7 +180,7 @@ TimeZoneSettingObserver::Observe(nsISupports *aSubject,
// Get the key, which should be the JS string "time.timezone".
JSObject &obj(val.toObject());
JS::Value key;
JS::Rooted<JS::Value> key(cx);
if (!JS_GetProperty(cx, &obj, "key", &key) ||
!key.isString()) {
return NS_OK;
@ -192,7 +192,7 @@ TimeZoneSettingObserver::Observe(nsISupports *aSubject,
}
// Get the value, which should be a JS string like "America/Chicago".
JS::Value value;
JS::Rooted<JS::Value> value(cx);
if (!JS_GetProperty(cx, &obj, "value", &value) ||
!value.isString()) {
return NS_OK;

Просмотреть файл

@ -35,7 +35,6 @@ var interfaceNamesInGlobalScope =
"BeforeUnloadEvent",
"Blob",
"BlobEvent",
"BoxObject",
"CameraCapabilities",
"CameraControl",
"CameraManager",
@ -483,10 +482,6 @@ var interfaceNamesInGlobalScope =
"TouchEvent",
"TouchList",
"TransitionEvent",
"TreeColumn",
"TreeColumns",
"TreeContentView",
"TreeSelection",
"TreeWalker",
"UIEvent",
"UndoManager",
@ -532,9 +527,7 @@ var interfaceNamesInGlobalScope =
"XULRelatedElement",
"XULSelectControlElement",
"XULSelectControlItemElement",
"XULTemplateBuilder",
"XULTextBoxElement",
"XULTreeBuilder",
"XULTreeElement",
]
// IMPORTANT: Do not change this list without review from a DOM peer!

Просмотреть файл

@ -5,6 +5,7 @@
interface MozTreeBoxObject;
interface MozTreeColumn;
[ChromeOnly]
interface TreeColumns {
/**
* The tree widget for these columns.

Просмотреть файл

@ -55,7 +55,7 @@ DefineChromeWorkerFunctions(JSContext* aCx, JS::Handle<JSObject*> aGlobal)
{
JS::Rooted<JS::Value> ctypes(aCx);
if (!JS_InitCTypesClass(aCx, aGlobal) ||
!JS_GetProperty(aCx, aGlobal, "ctypes", ctypes.address())) {
!JS_GetProperty(aCx, aGlobal, "ctypes", &ctypes)) {
return false;
}

Просмотреть файл

@ -298,7 +298,7 @@ EventListenerManager::DispatchEvent(JSContext* aCx, const EventTarget& aTarget,
}
JS::Rooted<JS::Value> val(aCx);
if (!JS_GetProperty(aCx, aEvent, "target", val.address())) {
if (!JS_GetProperty(aCx, aEvent, "target", &val)) {
aRv.Throw(NS_ERROR_FAILURE);
return false;
}
@ -316,7 +316,7 @@ EventListenerManager::DispatchEvent(JSContext* aCx, const EventTarget& aTarget,
JS::Rooted<JSString*> eventType(aCx);
JSBool eventIsTrusted;
if (!JS_GetProperty(aCx, aEvent, "type", val.address()) ||
if (!JS_GetProperty(aCx, aEvent, "type", &val) ||
!(eventType = JS_ValueToString(aCx, val)) ||
!(eventType = JS_InternJSString(aCx, eventType))) {
aRv.Throw(NS_ERROR_FAILURE);
@ -325,7 +325,7 @@ EventListenerManager::DispatchEvent(JSContext* aCx, const EventTarget& aTarget,
// We have already ensure that the event is one of our types of events so
// there is no need to worry about this property being faked.
if (!JS_GetProperty(aCx, aEvent, "isTrusted", val.address()) ||
if (!JS_GetProperty(aCx, aEvent, "isTrusted", &val) ||
!JS_ValueToBoolean(aCx, val, &eventIsTrusted)) {
aRv.Throw(NS_ERROR_FAILURE);
return false;
@ -408,7 +408,7 @@ EventListenerManager::DispatchEvent(JSContext* aCx, const EventTarget& aTarget,
}
if (hasHandleEvent) {
if (!JS_GetProperty(aCx, listenerObj, sHandleEventChars, listenerVal.address())) {
if (!JS_GetProperty(aCx, listenerObj, sHandleEventChars, &listenerVal)) {
if (!JS_ReportPendingException(aCx)) {
aRv.Throw(NS_ERROR_FAILURE);
return false;

Просмотреть файл

@ -57,14 +57,14 @@ public:
if (aMainRuntime) {
JS::Rooted<JS::Value> windowPropVal(aCx);
if (!JS_GetProperty(aCx, aObj, sClass.name, windowPropVal.address())) {
if (!JS_GetProperty(aCx, aObj, sClass.name, &windowPropVal)) {
return NULL;
}
if (!JSVAL_IS_PRIMITIVE(windowPropVal)) {
JS::Rooted<JS::Value> protoVal(aCx);
if (!JS_GetProperty(aCx, JSVAL_TO_OBJECT(windowPropVal), "prototype",
protoVal.address())) {
&protoVal)) {
return NULL;
}

Просмотреть файл

@ -266,9 +266,10 @@ private:
JS::Rooted<JSObject*> event(aCx, &JS_ARGV(aCx, aVp)[0].toObject());
jsval argv[3] = { JSVAL_VOID, JSVAL_VOID, JSVAL_VOID };
if (!JS_GetProperty(aCx, event, "message", &argv[0]) ||
!JS_GetProperty(aCx, event, "filename", &argv[1]) ||
!JS_GetProperty(aCx, event, "lineno", &argv[2])) {
JS::AutoArrayRooter rootedArgv(aCx, ArrayLength(argv), argv);
if (!JS_GetProperty(aCx, event, "message", rootedArgv.handleAt(0)) ||
!JS_GetProperty(aCx, event, "filename", rootedArgv.handleAt(1)) ||
!JS_GetProperty(aCx, event, "lineno", rootedArgv.handleAt(2))) {
return false;
}

Просмотреть файл

@ -241,6 +241,8 @@ ContainerLayerD3D10::RenderLayer()
effect()->GetVariableByName("vRenderTargetOffset")->
GetRawValue(previousRenderTargetOffset, 0, 8);
previousViewportSize = mD3DManager->GetViewport();
if (mVisibleRegion.GetNumRects() != 1 || !(GetContentFlags() & CONTENT_OPAQUE)) {
const gfx3DMatrix& transform3D = GetEffectiveTransform();
gfxMatrix transform;
@ -256,10 +258,10 @@ ContainerLayerD3D10::RenderLayer()
// applied to use relative to our parent, and compensates for the offset
// that was applied on our parent's rendering.
D3D10_BOX srcBox;
srcBox.left = visibleRect.x + int32_t(transform.x0) - int32_t(previousRenderTargetOffset[0]);
srcBox.top = visibleRect.y + int32_t(transform.y0) - int32_t(previousRenderTargetOffset[1]);
srcBox.right = srcBox.left + visibleRect.width;
srcBox.bottom = srcBox.top + visibleRect.height;
srcBox.left = std::max<int32_t>(visibleRect.x + int32_t(transform.x0) - int32_t(previousRenderTargetOffset[0]), 0);
srcBox.top = std::max<int32_t>(visibleRect.y + int32_t(transform.y0) - int32_t(previousRenderTargetOffset[1]), 0);
srcBox.right = std::min<int32_t>(srcBox.left + visibleRect.width, previousViewportSize.width);
srcBox.bottom = std::min<int32_t>(srcBox.top + visibleRect.height, previousViewportSize.height);
srcBox.back = 1;
srcBox.front = 0;
@ -284,7 +286,6 @@ ContainerLayerD3D10::RenderLayer()
effect()->GetVariableByName("vRenderTargetOffset")->
SetRawValue(renderTargetOffset, 0, 8);
previousViewportSize = mD3DManager->GetViewport();
mD3DManager->SetViewport(nsIntSize(visibleRect.Size()));
}

Просмотреть файл

@ -12,6 +12,8 @@
#include <dlfcn.h>
#include "mozilla/Util.h"
namespace mozilla {
struct udev;
@ -22,8 +24,17 @@ struct udev_monitor;
class udev_lib {
public:
udev_lib() : lib(dlopen("libudev.so.0", RTLD_LAZY | RTLD_GLOBAL)),
udev(NULL) {
udev_lib() : lib(nullptr),
udev(nullptr) {
// Be careful about ABI compat! 0 -> 1 didn't change any
// symbols this code relies on, per:
// https://lists.fedoraproject.org/pipermail/devel/2012-June/168227.html
const char* lib_names[] = {"libudev.so.0", "libudev.so.1"};
for (unsigned i = 0; i < ArrayLength(lib_names); i++) {
lib = dlopen(lib_names[i], RTLD_LAZY | RTLD_GLOBAL);
if (lib)
break;
}
if (lib && LoadSymbols())
udev = udev_new();
}

Просмотреть файл

@ -124,5 +124,14 @@ UnpackChannelOpened(const PrivateIPDLInterface&,
return ChannelOpened::Read(aMsg, aTransport, aOtherProcess, aProtocol);
}
void
ProtocolErrorBreakpoint(const char* aMsg)
{
// Bugs that generate these error messages can be tough to
// reproduce. Log always in the hope that someone finds the error
// message.
printf_stderr("IPDL protocol error: %s\n", aMsg);
}
} // namespace ipc
} // namespace mozilla

Просмотреть файл

@ -112,14 +112,8 @@ LoggingEnabled()
#endif
}
inline void
ProtocolErrorBreakpoint(const char* aMsg)
{
// Bugs that generate these error messages can be tough to
// reproduce. Log always in the hope that someone finds the error
// message.
printf_stderr("IPDL protocol error: %s\n", aMsg);
}
void
ProtocolErrorBreakpoint(const char* aMsg);
typedef IPCMessageStart ProtocolId;

Просмотреть файл

@ -78,7 +78,7 @@ Environment(JSObject* global)
AutoSafeJSContext cx;
JSAutoCompartment ac(cx, global);
Rooted<Value> v(cx);
if (!JS_GetProperty(cx, global, "__XPCShellEnvironment", v.address()) ||
if (!JS_GetProperty(cx, global, "__XPCShellEnvironment", &v) ||
!v.get().isDouble())
{
return nullptr;

Просмотреть файл

@ -372,7 +372,7 @@ JavaScriptChild::AnswerGet(const ObjectId &objId, const ObjectId &receiverId, co
if (!convertGeckoStringToId(cx, id, &internedId))
return fail(cx, rs);
JS::Value val;
JS::Rooted<JS::Value> val(cx);
if (!JS_ForwardGetPropertyTo(cx, obj, internedId, receiver, &val))
return fail(cx, rs);
@ -516,7 +516,7 @@ JavaScriptChild::AnswerCall(const ObjectId &objId, const nsTArray<JSParam> &argv
for (size_t i = 0; i < outobjects.length(); i++) {
RootedObject obj(cx, &outobjects[i].toObject());
jsval v;
RootedValue v(cx);
JSBool found;
if (JS_HasProperty(cx, obj, "value", &found)) {
if (!JS_GetProperty(cx, obj, "value", &v))

Просмотреть файл

@ -457,7 +457,7 @@ JavaScriptShared::Wrap(JSContext *cx, HandleObject aObj, InfallibleTArray<CpowEn
if (!convertIdToGeckoString(cx, id, &str))
return false;
if (!JS_GetPropertyById(cx, aObj, id, v.address()))
if (!JS_GetPropertyById(cx, aObj, id, &v))
return false;
JSVariant var;

Просмотреть файл

@ -509,7 +509,7 @@ jsd_GetValueProperty(JSDContext* jsdc, JSDValue* jsdval, JSString* nameStr)
JS_ClearPendingException(cx);
if(!JS_GetUCProperty(cx, obj, nameChars, nameLen, val.address()))
if(!JS_GetUCProperty(cx, obj, nameChars, nameLen, &val))
{
if (JS_IsExceptionPending(cx))
{

Просмотреть файл

@ -1257,7 +1257,7 @@ static bool GetObjectProperty(JSContext *cx, HandleObject obj,
const char *property, MutableHandleObject result)
{
RootedValue val(cx);
if (!JS_GetProperty(cx, obj, property, val.address())) {
if (!JS_GetProperty(cx, obj, property, &val)) {
return false;
}
@ -2544,7 +2544,7 @@ ImplicitConvert(JSContext* cx,
return false;
RootedValue prop(cx);
if (!JS_GetPropertyById(cx, valObj, id, prop.address()))
if (!JS_GetPropertyById(cx, valObj, id, &prop))
return false;
// Convert the field via ImplicitConvert().
@ -4292,7 +4292,7 @@ ArrayType::ConstructData(JSContext* cx,
// This could be a JS array, or a CData array.
RootedObject arg(cx, &args[0].toObject());
RootedValue lengthVal(cx);
if (!JS_GetProperty(cx, arg, "length", lengthVal.address()) ||
if (!JS_GetProperty(cx, arg, "length", &lengthVal) ||
!jsvalToSize(cx, lengthVal, false, &length)) {
JS_ReportError(cx, "argument must be an array object or length");
return JS_FALSE;
@ -4644,7 +4644,7 @@ ExtractStructField(JSContext* cx, jsval val, JSObject** typeObj)
}
RootedValue propVal(cx);
if (!JS_GetPropertyById(cx, obj, nameid, propVal.address()))
if (!JS_GetPropertyById(cx, obj, nameid, &propVal))
return NULL;
if (propVal.isPrimitive() || !CType::IsCType(&propVal.toObject())) {
@ -7411,7 +7411,7 @@ Int64::Construct(JSContext* cx,
// Get ctypes.Int64.prototype from the 'prototype' property of the ctor.
RootedValue slot(cx);
RootedObject callee(cx, &args.callee());
ASSERT_OK(JS_GetProperty(cx, callee, "prototype", slot.address()));
ASSERT_OK(JS_GetProperty(cx, callee, "prototype", &slot));
RootedObject proto(cx, JSVAL_TO_OBJECT(slot));
JS_ASSERT(JS_GetClass(proto) == &sInt64ProtoClass);
@ -7581,7 +7581,7 @@ UInt64::Construct(JSContext* cx,
// Get ctypes.UInt64.prototype from the 'prototype' property of the ctor.
RootedValue slot(cx);
RootedObject callee(cx, &args.callee());
ASSERT_OK(JS_GetProperty(cx, callee, "prototype", slot.address()));
ASSERT_OK(JS_GetProperty(cx, callee, "prototype", &slot));
RootedObject proto(cx, &slot.toObject());
JS_ASSERT(JS_GetClass(proto) == &sUInt64ProtoClass);

Просмотреть файл

@ -2808,7 +2808,7 @@ InstructionIterator::InstructionIterator(Instruction *i_) : i(i_) {
const PoolHeader *ph;
// If this is a guard, and the next instruction is a header, always work around the pool
// If it isn't a guard, then start looking ahead.
if (InstIsGuard(i, &ph)) {
if (InstIsArtificialGuard(i, &ph)) {
i = i->next();
}
}

Просмотреть файл

@ -342,6 +342,14 @@ MacroAssemblerARM::ma_movPatchable(Imm32 imm_, Register dest,
Assembler::Condition c, RelocStyle rs, Instruction *i)
{
int32_t imm = imm_.value;
if (i) {
// Make sure the current instruction is not an artificial guard
// inserted by the assembler buffer.
// The InstructionIterator already does this and handles edge cases,
// so, just asking an iterator for its current instruction should be
// enough to make sure we don't accidentally inspect an artificial guard.
i = InstructionIterator(i).cur();
}
switch(rs) {
case L_MOVWT:
as_movw(dest, Imm16(imm & 0xffff), c, i);

Просмотреть файл

@ -39,9 +39,9 @@ BEGIN_TEST(testArrayBuffer_bug720949_steal)
// Byte lengths should all agree
CHECK(JS_IsArrayBufferObject(obj));
CHECK_EQUAL(JS_GetArrayBufferByteLength(obj), size);
JS_GetProperty(cx, obj, "byteLength", v.address());
JS_GetProperty(cx, obj, "byteLength", &v);
CHECK_SAME(v, INT_TO_JSVAL(size));
JS_GetProperty(cx, view, "byteLength", v.address());
JS_GetProperty(cx, view, "byteLength", &v);
CHECK_SAME(v, INT_TO_JSVAL(size));
// Modifying the underlying data should update the value returned through the view
@ -59,13 +59,13 @@ BEGIN_TEST(testArrayBuffer_bug720949_steal)
// Check that the original ArrayBuffer is neutered
CHECK_EQUAL(JS_GetArrayBufferByteLength(obj), 0);
CHECK(JS_GetProperty(cx, obj, "byteLength", v.address()));
CHECK(JS_GetProperty(cx, obj, "byteLength", &v));
CHECK_SAME(v, INT_TO_JSVAL(0));
CHECK(JS_GetProperty(cx, view, "byteLength", v.address()));
CHECK(JS_GetProperty(cx, view, "byteLength", &v));
CHECK_SAME(v, INT_TO_JSVAL(0));
CHECK(JS_GetProperty(cx, view, "byteOffset", v.address()));
CHECK(JS_GetProperty(cx, view, "byteOffset", &v));
CHECK_SAME(v, INT_TO_JSVAL(0));
CHECK(JS_GetProperty(cx, view, "length", v.address()));
CHECK(JS_GetProperty(cx, view, "length", &v));
CHECK_SAME(v, INT_TO_JSVAL(0));
CHECK_EQUAL(JS_GetArrayBufferByteLength(obj), 0);
v = JSVAL_VOID;
@ -164,7 +164,7 @@ BEGIN_TEST(testArrayBuffer_bug720949_viewList)
bool isNeutered(JS::HandleObject obj) {
JS::RootedValue v(cx);
return JS_GetProperty(cx, obj, "byteLength", v.address()) && v.toInt32() == 0;
return JS_GetProperty(cx, obj, "byteLength", &v) && v.toInt32() == 0;
}
END_TEST(testArrayBuffer_bug720949_viewList)

Просмотреть файл

@ -18,7 +18,7 @@ BEGIN_TEST(testException_bug860435)
JS_CallFunctionValue(cx, global, fun, 0, v.address(), v.address());
CHECK(v.isObject());
JS_GetProperty(cx, &v.toObject(), "stack", v.address());
JS_GetProperty(cx, &v.toObject(), "stack", &v);
CHECK(v.isString());
return true;
}

Просмотреть файл

@ -15,10 +15,10 @@ BEGIN_TEST(testFunctionProperties)
JS::RootedObject obj(cx, JSVAL_TO_OBJECT(x));
JS::RootedValue y(cx);
CHECK(JS_GetProperty(cx, obj, "arguments", y.address()));
CHECK(JS_GetProperty(cx, obj, "arguments", &y));
CHECK_SAME(y, JSVAL_NULL);
CHECK(JS_GetProperty(cx, obj, "caller", y.address()));
CHECK(JS_GetProperty(cx, obj, "caller", &y));
CHECK_SAME(y, JSVAL_NULL);
return true;

Просмотреть файл

@ -32,11 +32,11 @@ BEGIN_TEST(testGetPropertyDefault_bug594060)
CHECK(JS_SetProperty(cx, obj, "here", v0));
JS::RootedValue v1(cx);
CHECK(JS_GetPropertyDefault(cx, obj, "here", JSVAL_FALSE, v1.address()));
CHECK(JS_GetPropertyDefault(cx, obj, "here", JSVAL_FALSE, &v1));
CHECK(JSVAL_IS_TRUE(v1));
JS::RootedValue v2(cx);
CHECK(JS_GetPropertyDefault(cx, obj, "nothere", JSVAL_FALSE, v2.address()));
CHECK(JS_GetPropertyDefault(cx, obj, "nothere", JSVAL_FALSE, &v2));
CHECK(JSVAL_IS_FALSE(v2));
}
@ -56,11 +56,11 @@ BEGIN_TEST(testGetPropertyDefault_bug594060)
CHECK(JS_SetPropertyById(cx, obj, hereid, v0));
JS::RootedValue v1(cx);
CHECK(JS_GetPropertyByIdDefault(cx, obj, hereid, JSVAL_FALSE, v1.address()));
CHECK(JS_GetPropertyByIdDefault(cx, obj, hereid, JSVAL_FALSE, &v1));
CHECK(JSVAL_IS_TRUE(v1));
JS::RootedValue v2(cx);
CHECK(JS_GetPropertyByIdDefault(cx, obj, nothereid, JSVAL_FALSE, v2.address()));
CHECK(JS_GetPropertyByIdDefault(cx, obj, nothereid, JSVAL_FALSE, &v2));
CHECK(JSVAL_IS_FALSE(v2));
}

Просмотреть файл

@ -114,16 +114,16 @@ BEGIN_TEST(testParseJSON_success)
CHECK(!JSVAL_IS_PRIMITIVE(v));
obj = JSVAL_TO_OBJECT(v);
CHECK(JS_IsArrayObject(cx, obj));
CHECK(JS_GetProperty(cx, obj, "length", v2.address()));
CHECK(JS_GetProperty(cx, obj, "length", &v2));
CHECK_SAME(v2, JSVAL_ZERO);
CHECK(Parse(cx, "[1]", &v));
CHECK(!JSVAL_IS_PRIMITIVE(v));
obj = JSVAL_TO_OBJECT(v);
CHECK(JS_IsArrayObject(cx, obj));
CHECK(JS_GetProperty(cx, obj, "0", v2.address()));
CHECK(JS_GetProperty(cx, obj, "0", &v2));
CHECK_SAME(v2, JSVAL_ONE);
CHECK(JS_GetProperty(cx, obj, "length", v2.address()));
CHECK(JS_GetProperty(cx, obj, "length", &v2));
CHECK_SAME(v2, JSVAL_ONE);
@ -137,7 +137,7 @@ BEGIN_TEST(testParseJSON_success)
CHECK(!JSVAL_IS_PRIMITIVE(v));
obj = JSVAL_TO_OBJECT(v);
CHECK(!JS_IsArrayObject(cx, obj));
CHECK(JS_GetProperty(cx, obj, "f", v2.address()));
CHECK(JS_GetProperty(cx, obj, "f", &v2));
CHECK_SAME(v2, INT_TO_JSVAL(17));
return true;

Просмотреть файл

@ -3770,13 +3770,14 @@ JS_SetUCPropertyAttributes(JSContext *cx, JSObject *objArg, const jschar *name,
}
JS_PUBLIC_API(JSBool)
JS_GetPropertyById(JSContext *cx, JSObject *objArg, jsid idArg, jsval *vp)
JS_GetPropertyById(JSContext *cx, JSObject *objArg, jsid idArg, MutableHandleValue vp)
{
return JS_ForwardGetPropertyTo(cx, objArg, idArg, objArg, vp);
}
JS_PUBLIC_API(JSBool)
JS_ForwardGetPropertyTo(JSContext *cx, JSObject *objArg, jsid idArg, JSObject *onBehalfOfArg, jsval *vp)
JS_ForwardGetPropertyTo(JSContext *cx, JSObject *objArg, jsid idArg, JSObject *onBehalfOfArg,
MutableHandleValue vp)
{
RootedObject obj(cx, objArg);
RootedObject onBehalfOf(cx, onBehalfOfArg);
@ -3788,27 +3789,18 @@ JS_ForwardGetPropertyTo(JSContext *cx, JSObject *objArg, jsid idArg, JSObject *o
assertSameCompartment(cx, onBehalfOf);
JSAutoResolveFlags rf(cx, 0);
RootedValue value(cx);
if (!JSObject::getGeneric(cx, obj, onBehalfOf, id, &value))
return false;
*vp = value;
return true;
return JSObject::getGeneric(cx, obj, onBehalfOf, id, vp);
}
JS_PUBLIC_API(JSBool)
JS_GetPropertyByIdDefault(JSContext *cx, JSObject *objArg, jsid idArg, jsval defArg, jsval *vp)
JS_GetPropertyByIdDefault(JSContext *cx, JSObject *objArg, jsid idArg, jsval defArg,
MutableHandleValue vp)
{
RootedObject obj(cx, objArg);
RootedId id(cx, idArg);
RootedValue def(cx, defArg);
RootedValue value(cx);
if (!baseops::GetPropertyDefault(cx, obj, id, def, &value))
return false;
*vp = value;
return true;
return baseops::GetPropertyDefault(cx, obj, id, def, vp);
}
JS_PUBLIC_API(JSBool)
@ -3856,7 +3848,7 @@ JS_GetElementIfPresent(JSContext *cx, JSObject *objArg, uint32_t index, JSObject
}
JS_PUBLIC_API(JSBool)
JS_GetProperty(JSContext *cx, JSObject *objArg, const char *name, jsval *vp)
JS_GetProperty(JSContext *cx, JSObject *objArg, const char *name, MutableHandleValue vp)
{
RootedObject obj(cx, objArg);
JSAtom *atom = Atomize(cx, name, strlen(name));
@ -3864,7 +3856,8 @@ JS_GetProperty(JSContext *cx, JSObject *objArg, const char *name, jsval *vp)
}
JS_PUBLIC_API(JSBool)
JS_GetPropertyDefault(JSContext *cx, JSObject *objArg, const char *name, jsval defArg, jsval *vp)
JS_GetPropertyDefault(JSContext *cx, JSObject *objArg, const char *name, jsval defArg,
MutableHandleValue vp)
{
RootedObject obj(cx, objArg);
RootedValue def(cx, defArg);
@ -3873,7 +3866,8 @@ JS_GetPropertyDefault(JSContext *cx, JSObject *objArg, const char *name, jsval d
}
JS_PUBLIC_API(JSBool)
JS_GetUCProperty(JSContext *cx, JSObject *objArg, const jschar *name, size_t namelen, jsval *vp)
JS_GetUCProperty(JSContext *cx, JSObject *objArg, const jschar *name, size_t namelen,
MutableHandleValue vp)
{
RootedObject obj(cx, objArg);
JSAtom *atom = AtomizeChars<CanGC>(cx, name, AUTO_NAMELEN(name, namelen));

Просмотреть файл

@ -3507,19 +3507,22 @@ extern JS_PUBLIC_API(JSBool)
JS_GetOwnPropertyDescriptor(JSContext *cx, JSObject *obj, jsid id, jsval *vp);
extern JS_PUBLIC_API(JSBool)
JS_GetProperty(JSContext *cx, JSObject *obj, const char *name, jsval *vp);
JS_GetProperty(JSContext *cx, JSObject *obj, const char *name, JS::MutableHandle<JS::Value> vp);
extern JS_PUBLIC_API(JSBool)
JS_GetPropertyDefault(JSContext *cx, JSObject *obj, const char *name, jsval def, jsval *vp);
JS_GetPropertyDefault(JSContext *cx, JSObject *obj, const char *name, jsval def,
JS::MutableHandle<JS::Value> vp);
extern JS_PUBLIC_API(JSBool)
JS_GetPropertyById(JSContext *cx, JSObject *obj, jsid id, jsval *vp);
JS_GetPropertyById(JSContext *cx, JSObject *obj, jsid id, JS::MutableHandle<JS::Value> vp);
extern JS_PUBLIC_API(JSBool)
JS_GetPropertyByIdDefault(JSContext *cx, JSObject *obj, jsid id, jsval def, jsval *vp);
JS_GetPropertyByIdDefault(JSContext *cx, JSObject *obj, jsid id, jsval def,
JS::MutableHandle<JS::Value> vp);
extern JS_PUBLIC_API(JSBool)
JS_ForwardGetPropertyTo(JSContext *cx, JSObject *obj, jsid id, JSObject *onBehalfOf, jsval *vp);
JS_ForwardGetPropertyTo(JSContext *cx, JSObject *obj, jsid id, JSObject *onBehalfOf,
JS::MutableHandle<JS::Value> vp);
extern JS_PUBLIC_API(JSBool)
JS_SetProperty(JSContext *cx, JSObject *obj, const char *name, JS::Handle<JS::Value> v);
@ -3605,7 +3608,7 @@ JS_LookupUCProperty(JSContext *cx, JSObject *obj,
extern JS_PUBLIC_API(JSBool)
JS_GetUCProperty(JSContext *cx, JSObject *obj,
const jschar *name, size_t namelen,
jsval *vp);
JS::MutableHandle<JS::Value> vp);
extern JS_PUBLIC_API(JSBool)
JS_SetUCProperty(JSContext *cx, JSObject *obj,

Просмотреть файл

@ -1105,10 +1105,10 @@ FormatFrame(JSContext *cx, const NonBuiltinScriptFrameIter &iter, char *buf, int
// print any unnamed trailing args (found in 'arguments' object)
RootedValue val(cx);
if (JS_GetProperty(cx, callObj, "arguments", val.address()) && val.isObject()) {
if (JS_GetProperty(cx, callObj, "arguments", &val) && val.isObject()) {
uint32_t argCount;
RootedObject argsObj(cx, &val.toObject());
if (JS_GetProperty(cx, argsObj, "length", val.address()) &&
if (JS_GetProperty(cx, argsObj, "length", &val) &&
ToUint32(cx, val, &argCount) &&
argCount > namedArgCount)
{
@ -1116,7 +1116,7 @@ FormatFrame(JSContext *cx, const NonBuiltinScriptFrameIter &iter, char *buf, int
char number[8];
JS_snprintf(number, 8, "%d", (int) k);
if (JS_GetProperty(cx, argsObj, number, val.address())) {
if (JS_GetProperty(cx, argsObj, number, &val)) {
JSAutoByteString valueBytes;
const char *value = FormatValue(cx, val, valueBytes);
buf = JS_sprintf_append(buf, "%s%s%s%s",

Просмотреть файл

@ -1048,14 +1048,14 @@ js_ReportUncaughtException(JSContext *cx)
(exnObject->is<ErrorObject>() || IsDuckTypedErrorObject(cx, exnObject, &filename_str)))
{
RootedString name(cx);
if (JS_GetProperty(cx, exnObject, js_name_str, &roots[2]) &&
if (JS_GetProperty(cx, exnObject, js_name_str, tvr.handleAt(2)) &&
JSVAL_IS_STRING(roots[2]))
{
name = JSVAL_TO_STRING(roots[2]);
}
RootedString msg(cx);
if (JS_GetProperty(cx, exnObject, js_message_str, &roots[3]) &&
if (JS_GetProperty(cx, exnObject, js_message_str, tvr.handleAt(3)) &&
JSVAL_IS_STRING(roots[3]))
{
msg = JSVAL_TO_STRING(roots[3]);
@ -1077,21 +1077,21 @@ js_ReportUncaughtException(JSContext *cx)
str = msg;
}
if (JS_GetProperty(cx, exnObject, filename_str, &roots[4])) {
if (JS_GetProperty(cx, exnObject, filename_str, tvr.handleAt(4))) {
JSString *tmp = ToString<CanGC>(cx, HandleValue::fromMarkedLocation(&roots[4]));
if (tmp)
filename.encodeLatin1(cx, tmp);
}
uint32_t lineno;
if (!JS_GetProperty(cx, exnObject, js_lineNumber_str, &roots[5]) ||
if (!JS_GetProperty(cx, exnObject, js_lineNumber_str, tvr.handleAt(5)) ||
!ToUint32(cx, roots[5], &lineno))
{
lineno = 0;
}
uint32_t column;
if (!JS_GetProperty(cx, exnObject, js_columnNumber_str, &roots[5]) ||
if (!JS_GetProperty(cx, exnObject, js_columnNumber_str, tvr.handleAt(5)) ||
!ToUint32(cx, roots[5], &column))
{
column = 0;

Просмотреть файл

@ -934,7 +934,7 @@ Evaluate(JSContext *cx, unsigned argc, jsval *vp)
RootedObject opts(cx, &args[1].toObject());
RootedValue v(cx);
if (!JS_GetProperty(cx, opts, "newContext", v.address()))
if (!JS_GetProperty(cx, opts, "newContext", &v))
return false;
if (!JSVAL_IS_VOID(v)) {
JSBool b;
@ -943,7 +943,7 @@ Evaluate(JSContext *cx, unsigned argc, jsval *vp)
newContext = b;
}
if (!JS_GetProperty(cx, opts, "compileAndGo", v.address()))
if (!JS_GetProperty(cx, opts, "compileAndGo", &v))
return false;
if (!JSVAL_IS_VOID(v)) {
JSBool b;
@ -952,7 +952,7 @@ Evaluate(JSContext *cx, unsigned argc, jsval *vp)
compileAndGo = b;
}
if (!JS_GetProperty(cx, opts, "noScriptRval", v.address()))
if (!JS_GetProperty(cx, opts, "noScriptRval", &v))
return false;
if (!JSVAL_IS_VOID(v)) {
JSBool b;
@ -961,7 +961,7 @@ Evaluate(JSContext *cx, unsigned argc, jsval *vp)
noScriptRval = b;
}
if (!JS_GetProperty(cx, opts, "fileName", v.address()))
if (!JS_GetProperty(cx, opts, "fileName", &v))
return false;
if (JSVAL_IS_NULL(v)) {
fileName = NULL;
@ -974,12 +974,12 @@ Evaluate(JSContext *cx, unsigned argc, jsval *vp)
return false;
}
if (!JS_GetProperty(cx, opts, "element", v.address()))
if (!JS_GetProperty(cx, opts, "element", &v))
return false;
if (!JSVAL_IS_PRIMITIVE(v))
element = JSVAL_TO_OBJECT(v);
if (!JS_GetProperty(cx, opts, "sourceMapURL", v.address()))
if (!JS_GetProperty(cx, opts, "sourceMapURL", &v))
return false;
if (!JSVAL_IS_VOID(v)) {
sourceMapURL = JS_ValueToString(cx, v);
@ -987,7 +987,7 @@ Evaluate(JSContext *cx, unsigned argc, jsval *vp)
return false;
}
if (!JS_GetProperty(cx, opts, "lineNumber", v.address()))
if (!JS_GetProperty(cx, opts, "lineNumber", &v))
return false;
if (!JSVAL_IS_VOID(v)) {
uint32_t u;
@ -996,7 +996,7 @@ Evaluate(JSContext *cx, unsigned argc, jsval *vp)
lineNumber = u;
}
if (!JS_GetProperty(cx, opts, "global", v.address()))
if (!JS_GetProperty(cx, opts, "global", &v))
return false;
if (!JSVAL_IS_VOID(v)) {
global = JSVAL_IS_PRIMITIVE(v) ? NULL : JSVAL_TO_OBJECT(v);
@ -1012,7 +1012,7 @@ Evaluate(JSContext *cx, unsigned argc, jsval *vp)
}
}
if (!JS_GetProperty(cx, opts, "catchTermination", v.address()))
if (!JS_GetProperty(cx, opts, "catchTermination", &v))
return false;
if (!JSVAL_IS_VOID(v)) {
JSBool b;
@ -1021,7 +1021,7 @@ Evaluate(JSContext *cx, unsigned argc, jsval *vp)
catchTermination = b;
}
if (!JS_GetProperty(cx, opts, "saveFrameChain", v.address()))
if (!JS_GetProperty(cx, opts, "saveFrameChain", &v))
return false;
if (!JSVAL_IS_VOID(v)) {
JSBool b;
@ -2465,7 +2465,7 @@ sandbox_enumerate(JSContext *cx, HandleObject obj)
RootedValue v(cx);
JSBool b;
if (!JS_GetProperty(cx, obj, "lazy", v.address()))
if (!JS_GetProperty(cx, obj, "lazy", &v))
return false;
JS_ValueToBoolean(cx, v, &b);
@ -2479,7 +2479,7 @@ sandbox_resolve(JSContext *cx, HandleObject obj, HandleId id, unsigned flags,
RootedValue v(cx);
JSBool b, resolved;
if (!JS_GetProperty(cx, obj, "lazy", v.address()))
if (!JS_GetProperty(cx, obj, "lazy", &v))
return false;
JS_ValueToBoolean(cx, v, &b);

Просмотреть файл

@ -506,7 +506,7 @@ ReferenceFinder::addReferrer(jsval referrerArg, Path *path)
/* Find the property of the results object named |pathName|. */
RootedValue v(context);
if (!JS_GetProperty(context, result, pathName, v.address()))
if (!JS_GetProperty(context, result, pathName, &v))
return false;
if (v.isUndefined()) {
/* Create an array to accumulate referents under this path. */

Просмотреть файл

@ -4194,7 +4194,7 @@ DebuggerGenericEval(JSContext *cx, const char *fullMethodName, const Value &code
RootedObject opts(cx, &options.toObject());
RootedValue v(cx);
if (!JS_GetProperty(cx, opts, "url", v.address()))
if (!JS_GetProperty(cx, opts, "url", &v))
return false;
if (!v.isUndefined()) {
RootedString url_str(cx, JS_ValueToString(cx, v));
@ -4203,7 +4203,7 @@ DebuggerGenericEval(JSContext *cx, const char *fullMethodName, const Value &code
url = JS_EncodeString(cx, url_str);
}
if (!JS_GetProperty(cx, opts, "lineNumber", v.address()))
if (!JS_GetProperty(cx, opts, "lineNumber", &v))
return false;
if (!v.isUndefined()) {
uint32_t lineno;

Просмотреть файл

@ -518,7 +518,7 @@ mozJSComponentLoader::LoadModule(FileLocation &aFile)
JSCLAutoErrorReporterSetter aers(cx, xpc::SystemErrorReporter);
RootedValue NSGetFactory_val(cx);
if (!JS_GetProperty(cx, entry->obj, "NSGetFactory", NSGetFactory_val.address()) ||
if (!JS_GetProperty(cx, entry->obj, "NSGetFactory", &NSGetFactory_val) ||
JSVAL_IS_VOID(NSGetFactory_val)) {
return NULL;
}
@ -1281,7 +1281,7 @@ mozJSComponentLoader::ImportInto(const nsACString &aLocation,
RootedValue symbols(mContext);
if (!JS_GetProperty(mContext, mod->obj,
"EXPORTED_SYMBOLS", symbols.address())) {
"EXPORTED_SYMBOLS", &symbols)) {
return ReportOnCaller(cxhelper, ERROR_NOT_PRESENT,
PromiseFlatCString(aLocation).get());
}
@ -1316,7 +1316,7 @@ mozJSComponentLoader::ImportInto(const nsACString &aLocation,
PromiseFlatCString(aLocation).get(), i);
}
if (!JS_GetPropertyById(mContext, mod->obj, symbolId, value.address())) {
if (!JS_GetPropertyById(mContext, mod->obj, symbolId, &value)) {
JSAutoByteString bytes(mContext, JSID_TO_STRING(symbolId));
if (!bytes)
return NS_ERROR_FAILURE;

Просмотреть файл

@ -1916,7 +1916,7 @@ struct MOZ_STACK_CLASS ExceptionArgParser
}
// Get the property.
return JS_GetProperty(cx, obj, name, rv.address());
return JS_GetProperty(cx, obj, name, rv);
}
/*
@ -2243,7 +2243,7 @@ nsXPCConstructor::CallOrConstruct(nsIXPConnectWrappedNative *wrapper,JSContext *
RootedObject newObj(cx, &rval.toObject());
// first check existence of function property for better error reporting
RootedValue fun(cx);
if (!JS_GetProperty(cx, newObj, mInitializer, fun.address()) ||
if (!JS_GetProperty(cx, newObj, mInitializer, &fun) ||
fun.isPrimitive()) {
return ThrowAndFail(NS_ERROR_XPC_BAD_INITIALIZER_NAME, cx, _retval);
}
@ -2492,7 +2492,7 @@ nsXPCComponents_Constructor::CallOrConstruct(nsIXPConnectWrappedNative *wrapper,
return ThrowAndFail(NS_ERROR_XPC_BAD_CONVERT_JS, cx, _retval);
RootedValue val(cx);
if (!JS_GetPropertyById(cx, ifacesObj, id, val.address()) || val.isPrimitive())
if (!JS_GetPropertyById(cx, ifacesObj, id, &val) || val.isPrimitive())
return ThrowAndFail(NS_ERROR_XPC_BAD_IID, cx, _retval);
nsCOMPtr<nsIXPConnectWrappedNative> wn;
@ -2541,7 +2541,7 @@ nsXPCComponents_Constructor::CallOrConstruct(nsIXPConnectWrappedNative *wrapper,
return ThrowAndFail(NS_ERROR_XPC_BAD_CONVERT_JS, cx, _retval);
RootedValue val(cx);
if (!JS_GetPropertyById(cx, classesObj, id, val.address()) || val.isPrimitive())
if (!JS_GetPropertyById(cx, classesObj, id, &val) || val.isPrimitive())
return ThrowAndFail(NS_ERROR_XPC_BAD_CID, cx, _retval);
nsCOMPtr<nsIXPConnectWrappedNative> wn;
@ -3526,7 +3526,7 @@ GetPropFromOptions(JSContext *cx, HandleObject from, const char *name, MutableHa
if (!JS_HasProperty(cx, from, name, found))
return NS_ERROR_INVALID_ARG;
if (found && !JS_GetProperty(cx, from, name, prop.address()))
if (found && !JS_GetProperty(cx, from, name, prop))
return NS_ERROR_INVALID_ARG;
return NS_OK;
@ -4275,7 +4275,7 @@ nsXPCComponents_Utils::MakeObjectPropsNormal(const Value &vobj, JSContext *cx)
for (size_t i = 0; i < ida.length(); ++i) {
id = ida[i];
if (!JS_GetPropertyById(cx, obj, id, v.address()))
if (!JS_GetPropertyById(cx, obj, id, &v))
return NS_ERROR_FAILURE;
if (v.isPrimitive())

Просмотреть файл

@ -230,7 +230,7 @@ nsXPCWrappedJSClass::CallQueryInterfaceOnJSObject(JSContext* cx,
// check upfront for the existence of the function property
funid = mRuntime->GetStringID(XPCJSRuntime::IDX_QUERY_INTERFACE);
if (!JS_GetPropertyById(cx, jsobj, funid, fun.address()) || JSVAL_IS_PRIMITIVE(fun))
if (!JS_GetPropertyById(cx, jsobj, funid, &fun) || JSVAL_IS_PRIMITIVE(fun))
return nullptr;
// Ensure that we are asking for a scriptable interface.
@ -330,7 +330,7 @@ GetNamedPropertyAsVariantRaw(XPCCallContext& ccx,
nsXPTType type = nsXPTType((uint8_t)TD_INTERFACE_TYPE);
RootedValue val(ccx);
return JS_GetPropertyById(ccx, aJSObj, aName, val.address()) &&
return JS_GetPropertyById(ccx, aJSObj, aName, &val) &&
// Note that this always takes the T_INTERFACE path through
// JSData2Native, so the value passed for useAllocator
// doesn't really matter. We pass true for consistency.
@ -1264,7 +1264,7 @@ nsXPCWrappedJSClass::CallMethod(nsXPCWrappedJS* wrapper, uint16_t methodIndex,
}
}
} else {
if (!JS_GetProperty(cx, obj, name, fval.address()))
if (!JS_GetProperty(cx, obj, name, &fval))
goto pre_call_clean_up;
// XXX We really want to factor out the error reporting better and
// specifically report the failure to find a function with this name.
@ -1431,7 +1431,7 @@ pre_call_clean_up:
RootedValue rval(cx);
if (XPT_MD_IS_GETTER(info->flags)) {
success = JS_GetProperty(cx, obj, name, rval.address());
success = JS_GetProperty(cx, obj, name, &rval);
} else if (XPT_MD_IS_SETTER(info->flags)) {
rval = *argv;
success = JS_SetProperty(cx, obj, name, rval);
@ -1514,7 +1514,7 @@ pre_call_clean_up:
else if (JSVAL_IS_PRIMITIVE(argv[i]) ||
!JS_GetPropertyById(cx, JSVAL_TO_OBJECT(argv[i]),
mRuntime->GetStringID(XPCJSRuntime::IDX_VALUE),
val.address()))
&val))
break;
// setup allocator and/or iid
@ -1558,7 +1558,7 @@ pre_call_clean_up:
val = rval;
else if (!JS_GetPropertyById(cx, JSVAL_TO_OBJECT(argv[i]),
mRuntime->GetStringID(XPCJSRuntime::IDX_VALUE),
val.address()))
&val))
break;
// setup allocator and/or iid

Просмотреть файл

@ -1993,7 +1993,7 @@ class CallMethodHelper
nsID* result) const;
JS_ALWAYS_INLINE JSBool
GetOutParamSource(uint8_t paramIndex, jsval* srcp) const;
GetOutParamSource(uint8_t paramIndex, MutableHandleValue srcp) const;
JS_ALWAYS_INLINE JSBool
GatherAndConvertResults();
@ -2249,7 +2249,7 @@ CallMethodHelper::GetInterfaceTypeFromParam(uint8_t paramIndex,
}
JSBool
CallMethodHelper::GetOutParamSource(uint8_t paramIndex, jsval* srcp) const
CallMethodHelper::GetOutParamSource(uint8_t paramIndex, MutableHandleValue srcp) const
{
const nsXPTParamInfo& paramInfo = mMethodInfo->GetParam(paramIndex);
@ -2529,7 +2529,7 @@ CallMethodHelper::ConvertIndependentParam(uint8_t i)
//
// This is a no-op for 'in' params.
RootedValue src(mCallContext);
if (!GetOutParamSource(i, src.address()))
if (!GetOutParamSource(i, &src))
return false;
// All that's left to do is value conversion. Bail early if we don't need
@ -2634,7 +2634,7 @@ CallMethodHelper::ConvertDependentParam(uint8_t i)
//
// This is a no-op for 'in' params.
RootedValue src(mCallContext);
if (!GetOutParamSource(i, src.address()))
if (!GetOutParamSource(i, &src))
return false;
// All that's left to do is value conversion. Bail early if we don't need

Просмотреть файл

@ -121,7 +121,7 @@ GetDoubleWrappedJSObject(XPCCallContext& ccx, XPCWrappedNative* wrapper)
JSAutoCompartment ac(ccx, mainObj);
RootedValue val(ccx);
if (JS_GetPropertyById(ccx, mainObj, id, val.address()) &&
if (JS_GetPropertyById(ccx, mainObj, id, &val) &&
!JSVAL_IS_PRIMITIVE(val)) {
obj = JSVAL_TO_OBJECT(val);
}

Просмотреть файл

@ -279,13 +279,11 @@ def write_header(iface, fd):
def write_getter(a, iface, fd):
realtype = a.realtype.nativeType('in')
fd.write(" NS_ENSURE_STATE(JS_GetPropertyById(aCx, aObj, %s, &v));\n"
% get_jsid(a.name))
if realtype.count("JS::Value"):
fd.write(" NS_ENSURE_STATE(JS_GetPropertyById(aCx, aObj, %s, &aDict.%s));\n"
% (get_jsid(a.name), a.name))
else:
fd.write(" NS_ENSURE_STATE(JS_GetPropertyById(aCx, aObj, %s, v.address()));\n"
% get_jsid(a.name))
if realtype.count("bool"):
fd.write(" aDict.%s = v;\n" % a.name)
elif realtype.count("bool"):
fd.write(" JSBool b;\n")
fd.write(" MOZ_ALWAYS_TRUE(JS_ValueToBoolean(aCx, v, &b));\n")
fd.write(" aDict.%s = b;\n" % a.name)
@ -373,15 +371,11 @@ def write_cpp(iface, fd):
fd.write(" NS_ENSURE_SUCCESS(rv, rv);\n")
fd.write(" JSBool found = JS_FALSE;\n")
needjsval = False
needccx = False
for a in attributes:
if not a.realtype.nativeType('in').count("JS::Value"):
needjsval = True
if a.realtype.nativeType('in').count("nsIVariant"):
needccx = True
if needjsval:
fd.write(" JS::RootedValue v(aCx, JSVAL_VOID);\n")
fd.write(" JS::RootedValue v(aCx, JSVAL_VOID);\n")
if needccx:
fd.write(" XPCCallContext ccx(NATIVE_CALLER, aCx);\n")
fd.write(" NS_ENSURE_STATE(ccx.IsValid());\n")

Просмотреть файл

@ -498,6 +498,9 @@ static void GetColorsForProperty(const uint32_t aParserVariant,
nsTArray<nsString>& aArray)
{
if (aParserVariant & VARIANT_COLOR) {
// GetKeywordsForProperty and GetOtherValuesForProperty assume aArray is sorted,
// and if aArray is not empty here, then it's not going to be sorted coming out.
MOZ_ASSERT(aArray.Length() == 0);
size_t size;
const char * const *allColorNames = NS_AllColorNames(&size);
for (size_t i = 0; i < size; i++) {
@ -544,6 +547,9 @@ static void GetOtherValuesForProperty(const uint32_t aParserVariant,
InsertNoDuplicates(aArray, NS_LITERAL_STRING("calc"));
InsertNoDuplicates(aArray, NS_LITERAL_STRING("-moz-calc"));
}
if (aParserVariant & VARIANT_URL) {
InsertNoDuplicates(aArray, NS_LITERAL_STRING("url"));
}
}
NS_IMETHODIMP
@ -569,10 +575,16 @@ inDOMUtils::GetCSSValuesForProperty(const nsAString& aProperty,
GetOtherValuesForProperty(propertyParserVariant, array);
} else {
// Property is shorthand.
CSSPROPS_FOR_SHORTHAND_SUBPROPERTIES(subproperty, propertyID) {
// Get colors (once) first.
uint32_t propertyParserVariant = nsCSSProps::ParserVariant(*subproperty);
if (propertyParserVariant & VARIANT_COLOR) {
GetColorsForProperty(propertyParserVariant, array);
break;
}
}
CSSPROPS_FOR_SHORTHAND_SUBPROPERTIES(subproperty, propertyID) {
uint32_t propertyParserVariant = nsCSSProps::ParserVariant(*subproperty);
// Get colors first.
GetColorsForProperty(propertyParserVariant, array);
GetKeywordsForProperty(*subproperty, array);
GetOtherValuesForProperty(propertyParserVariant, array);
}

Просмотреть файл

@ -91,7 +91,32 @@ function do_test() {
"violet", "wheat", "white", "whitesmoke", "yellow", "yellowgreen", "no-repeat", "repeat",
"repeat-x", "repeat-y", "fixed", "scroll", "local", "center", "top", "bottom", "left", "right",
"border-box", "padding-box", "content-box", "border-box", "padding-box", "content-box", "contain",
"cover", "rgb", "hsl", "-moz-rgba", "-moz-hsla", "rgba", "hsla", "none", "-moz-element", "-moz-image-rect" ];
"cover", "rgb", "hsl", "-moz-rgba", "-moz-hsla", "rgba", "hsla", "none", "-moz-element", "-moz-image-rect", "url" ];
ok(testValues(values, expected), "Shorthand property values.");
var prop = "border";
var values = utils.getCSSValuesForProperty(prop);
var expected = [ "-moz-calc", "-moz-hsla", "-moz-initial", "-moz-rgba", "-moz-use-text-color", "aliceblue",
"antiquewhite", "aqua", "aquamarine", "azure", "beige", "bisque", "black", "blanchedalmond", "blue", "blueviolet",
"brown", "burlywood", "cadetblue", "calc", "chartreuse", "chocolate", "coral", "cornflowerblue", "cornsilk",
"crimson", "cyan", "darkblue", "darkcyan", "darkgoldenrod", "darkgray", "darkgreen", "darkgrey", "darkkhaki",
"darkmagenta", "darkolivegreen", "darkorange", "darkorchid", "darkred", "darksalmon", "darkseagreen",
"darkslateblue", "darkslategray", "darkslategrey", "darkturquoise", "darkviolet", "dashed", "deeppink",
"deepskyblue", "dimgray", "dimgrey", "dodgerblue", "dotted", "double", "fill", "firebrick", "floralwhite",
"forestgreen", "fuchsia", "gainsboro", "ghostwhite", "gold", "goldenrod", "gray", "grey", "green", "greenyellow",
"groove", "hidden", "honeydew", "hotpink", "hsl", "hsla", "indianred", "indigo", "inherit", "inset", "ivory",
"khaki", "lavender", "lavenderblush", "lawngreen", "lemonchiffon", "lightblue", "lightcoral", "lightcyan",
"lightgoldenrodyellow", "lightgray", "lightgreen", "lightgrey", "lightpink", "lightsalmon", "lightseagreen",
"lightskyblue", "lightslategray", "lightslategrey", "lightsteelblue", "lightyellow", "lime", "limegreen",
"linen", "logical", "magenta", "maroon", "medium", "mediumaquamarine", "mediumblue", "mediumorchid",
"mediumpurple", "mediumseagreen", "mediumslateblue", "mediumspringgreen", "mediumturquoise",
"mediumvioletred", "midnightblue", "mintcream", "mistyrose", "moccasin", "navajowhite", "navy", "none",
"oldlace", "olive", "olivedrab", "orange", "orangered", "orchid", "outset", "palegoldenrod", "palegreen",
"paleturquoise", "palevioletred", "papayawhip", "peachpuff", "peru", "physical", "pink", "plum", "powderblue",
"purple", "red", "repeat", "rgb", "rgba", "ridge", "rosybrown", "round", "royalblue", "saddlebrown", "salmon",
"sandybrown", "seagreen", "seashell", "sienna", "silver", "skyblue", "slateblue", "slategray", "slategrey",
"snow", "solid", "springgreen", "steelblue", "stretch", "tan", "teal", "thick", "thin", "thistle", "tomato",
"transparent", "turquoise", "url", "violet", "wheat", "white", "whitesmoke", "yellow", "yellowgreen" ]
ok(testValues(values, expected), "Shorthand property values.");
// test keywords only

Просмотреть файл

@ -905,7 +905,7 @@ PeerConnectionImpl::ConvertConstraints(
JS::Rooted<JSObject*> constraints(aCx, &aConstraints.toObject());
// Mandatory constraints. Note that we only care if the constraint array exists
if (!JS_GetProperty(aCx, constraints, "mandatory", mandatory.address())) {
if (!JS_GetProperty(aCx, constraints, "mandatory", &mandatory)) {
return NS_ERROR_FAILURE;
}
if (!mandatory.isNullOrUndefined()) {
@ -919,7 +919,7 @@ PeerConnectionImpl::ConvertConstraints(
// Iterate over each property.
for (size_t i = 0; i < mandatoryOpts.length(); i++) {
JS::Rooted<JS::Value> option(aCx), optionName(aCx);
if (!JS_GetPropertyById(aCx, opts, mandatoryOpts[i], option.address()) ||
if (!JS_GetPropertyById(aCx, opts, mandatoryOpts[i], &option) ||
!JS_IdToValue(aCx, mandatoryOpts[i], optionName.address()) ||
// We only support boolean constraints for now.
!option.isBoolean()) {
@ -935,7 +935,7 @@ PeerConnectionImpl::ConvertConstraints(
}
// Optional constraints.
if (!JS_GetProperty(aCx, constraints, "optional", optional.address())) {
if (!JS_GetProperty(aCx, constraints, "optional", &optional)) {
return NS_ERROR_FAILURE;
}
if (!optional.isNullOrUndefined()) {
@ -961,7 +961,7 @@ PeerConnectionImpl::ConvertConstraints(
return NS_ERROR_FAILURE;
}
JS::Rooted<JS::Value> option(aCx), optionName(aCx);
if (!JS_GetPropertyById(aCx, opts, optionalOpts[0], option.address()) ||
if (!JS_GetPropertyById(aCx, opts, optionalOpts[0], &option) ||
!JS_IdToValue(aCx, optionalOpts[0], optionName.address())) {
return NS_ERROR_FAILURE;
}

Просмотреть файл

@ -41,6 +41,8 @@ endif
MOZ_GLUE_LDFLAGS = # Don't link against ourselves
DEFINES += -DIMPL_MFBT
ifeq (WINNT,$(OS_TARGET))
DEFFILE = mozglue.def

Просмотреть файл

@ -416,11 +416,11 @@ GetHistogramCounts(const char *testmsg, const nsACString &histogram_id,
JSFunction *snapshot_fn = NULL;
Rooted<Value> ss(cx);
return (JS_GetProperty(cx, JSVAL_TO_OBJECT(h), "snapshot",
snapshot_val.address())
&snapshot_val)
&& (snapshot_fn = JS_ValueToFunction(cx, snapshot_val))
&& JS::Call(cx, JSVAL_TO_OBJECT(h),
snapshot_fn, 0, NULL, &ss)
&& JS_GetProperty(cx, JSVAL_TO_OBJECT(ss), "counts", counts.address()));
&& JS_GetProperty(cx, JSVAL_TO_OBJECT(ss), "counts", counts));
}
nsresult

Просмотреть файл

@ -67,7 +67,7 @@ static JSBool
SealObjectAndPrototype(JSContext* cx, JSObject* parent, const char* name)
{
JS::Rooted<JS::Value> prop(cx);
if (!JS_GetProperty(cx, parent, name, prop.address()))
if (!JS_GetProperty(cx, parent, name, &prop))
return false;
if (prop.isUndefined()) {
@ -76,7 +76,7 @@ SealObjectAndPrototype(JSContext* cx, JSObject* parent, const char* name)
}
JS::Rooted<JSObject*> obj(cx, prop.toObjectOrNull());
if (!JS_GetProperty(cx, obj, "prototype", prop.address()))
if (!JS_GetProperty(cx, obj, "prototype", &prop))
return false;
JS::Rooted<JSObject*> prototype(cx, prop.toObjectOrNull());
@ -92,7 +92,7 @@ InitAndSealCTypesClass(JSContext* cx, JS::Handle<JSObject*> global)
// Set callbacks for charset conversion and such.
JS::Rooted<JS::Value> ctypes(cx);
if (!JS_GetProperty(cx, global, "ctypes", ctypes.address()))
if (!JS_GetProperty(cx, global, "ctypes", &ctypes))
return false;
JS_SetCTypesCallbacks(JSVAL_TO_OBJECT(ctypes), &sCallbacks);

Просмотреть файл

@ -42,7 +42,7 @@ static JSBool
SealObjectAndPrototype(JSContext* cx, JSObject* parent, const char* name)
{
JS::Rooted<JS::Value> prop(cx);
if (!JS_GetProperty(cx, parent, name, prop.address()))
if (!JS_GetProperty(cx, parent, name, &prop))
return false;
if (prop.isUndefined()) {
@ -51,7 +51,7 @@ SealObjectAndPrototype(JSContext* cx, JSObject* parent, const char* name)
}
JS::Rooted<JSObject*> obj(cx, prop.toObjectOrNull());
if (!JS_GetProperty(cx, obj, "prototype", prop.address()))
if (!JS_GetProperty(cx, obj, "prototype", &prop))
return false;
JS::Rooted<JSObject*> prototype(cx, prop.toObjectOrNull());

Просмотреть файл

@ -297,7 +297,7 @@ GetURIFromJSObject(JSContext* aCtx,
const char* aProperty)
{
JS::Rooted<JS::Value> uriVal(aCtx);
JSBool rc = JS_GetProperty(aCtx, aObject, aProperty, uriVal.address());
JSBool rc = JS_GetProperty(aCtx, aObject, aProperty, &uriVal);
NS_ENSURE_TRUE(rc, nullptr);
return GetJSValueAsURI(aCtx, uriVal);
}
@ -355,7 +355,7 @@ GetStringFromJSObject(JSContext* aCtx,
nsString& _string)
{
JS::Rooted<JS::Value> val(aCtx);
JSBool rc = JS_GetProperty(aCtx, aObject, aProperty, val.address());
JSBool rc = JS_GetProperty(aCtx, aObject, aProperty, &val);
if (!rc) {
_string.SetIsVoid(true);
return;
@ -385,7 +385,7 @@ GetIntFromJSObject(JSContext* aCtx,
IntType* _int)
{
JS::Rooted<JS::Value> value(aCtx);
JSBool rc = JS_GetProperty(aCtx, aObject, aProperty, value.address());
JSBool rc = JS_GetProperty(aCtx, aObject, aProperty, &value);
NS_ENSURE_TRUE(rc, NS_ERROR_UNEXPECTED);
if (JSVAL_IS_VOID(value)) {
return NS_ERROR_INVALID_ARG;
@ -2808,7 +2808,7 @@ History::UpdatePlaces(const JS::Value& aPlaceInfos,
JS::Rooted<JSObject*> visits(aCtx, nullptr);
{
JS::Rooted<JS::Value> visitsVal(aCtx);
JSBool rc = JS_GetProperty(aCtx, info, "visits", visitsVal.address());
JSBool rc = JS_GetProperty(aCtx, info, "visits", &visitsVal);
NS_ENSURE_TRUE(rc, NS_ERROR_UNEXPECTED);
if (!JSVAL_IS_PRIMITIVE(visitsVal)) {
visits = JSVAL_TO_OBJECT(visitsVal);