From d8f824e34ef1128e272b83729add15afbad2b53c Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Thu, 8 Aug 2013 15:53:04 -0700 Subject: [PATCH] Bug 898914 (part 1) - Remove JSBool. --HG-- extra : rebase_source : 2d202e0e5005a7f54724b1540481c15cde3ad52e --- caps/include/nsJSPrincipals.h | 2 +- caps/include/nsScriptSecurityManager.h | 4 +- caps/src/nsJSPrincipals.cpp | 2 +- caps/src/nsScriptSecurityManager.cpp | 4 +- content/base/src/nsFrameMessageManager.cpp | 2 +- content/xbl/src/nsXBLBinding.cpp | 2 +- content/xbl/src/nsXBLDocumentInfo.cpp | 18 +- content/xbl/src/nsXBLProtoImpl.cpp | 2 +- content/xbl/src/nsXBLProtoImplField.cpp | 4 +- content/xbl/src/nsXBLProtoImplMethod.cpp | 2 +- .../document/src/nsXULPrototypeDocument.cpp | 4 +- dom/base/nsDOMClassInfo.cpp | 48 +- dom/base/nsDOMClassInfo.h | 28 +- dom/base/nsGlobalWindow.cpp | 2 +- dom/base/nsJSEnvironment.cpp | 6 +- dom/base/nsJSEnvironment.h | 8 +- dom/base/nsJSUtils.cpp | 2 +- dom/base/nsJSUtils.h | 8 +- dom/base/nsStructuredCloneContainer.cpp | 2 +- dom/bindings/BindingUtils.cpp | 20 +- dom/bindings/BindingUtils.h | 14 +- dom/bindings/Codegen.py | 37 +- dom/bindings/DOMJSProxyHandler.cpp | 6 +- dom/bindings/PrimitiveConversions.h | 2 +- dom/bluetooth/BluetoothHfpManager.cpp | 2 +- dom/bluetooth/BluetoothService.cpp | 2 +- dom/indexedDB/IDBKeyRange.cpp | 8 +- dom/indexedDB/IDBKeyRange.h | 4 +- dom/indexedDB/IDBObjectStore.cpp | 2 +- dom/indexedDB/IDBObjectStore.h | 2 +- dom/indexedDB/IndexedDatabaseManager.cpp | 2 +- dom/indexedDB/KeyPath.cpp | 10 +- dom/ipc/StructuredCloneUtils.cpp | 2 +- dom/ipc/TabParent.h | 2 +- dom/plugins/base/nsJSNPRuntime.cpp | 76 +-- .../ipc/PluginScriptableObjectParent.cpp | 2 +- .../ipc/PluginScriptableObjectParent.h | 8 +- dom/src/geolocation/nsGeolocation.cpp | 2 +- dom/src/json/nsJSON.cpp | 4 +- dom/system/gonk/TimeZoneSettingObserver.cpp | 2 +- dom/workers/EventListenerManager.cpp | 4 +- dom/workers/Events.cpp | 30 +- dom/workers/Exceptions.cpp | 4 +- dom/workers/File.cpp | 10 +- dom/workers/RuntimeService.cpp | 6 +- dom/workers/Worker.cpp | 6 +- dom/workers/WorkerPrivate.cpp | 8 +- dom/workers/WorkerScope.cpp | 32 +- dom/workers/Workers.h | 2 +- .../archive/0010-Bug-689069-ARM-Opts.patch | 4 +- gfx/skia/src/xml/SkJS.cpp | 8 +- gfx/skia/src/xml/SkJSDisplayable.cpp | 18 +- ipc/testshell/TestShellParent.cpp | 8 +- ipc/testshell/TestShellParent.h | 5 +- ipc/testshell/XPCShellEnvironment.cpp | 10 +- ipc/testshell/XPCShellEnvironment.h | 6 +- js/ipc/JavaScriptChild.cpp | 8 +- js/ipc/JavaScriptParent.cpp | 2 +- js/ipc/JavaScriptShared.cpp | 6 +- js/jsd/jsd.h | 124 ++--- js/jsd/jsd_atom.cpp | 2 +- js/jsd/jsd_high.cpp | 12 +- js/jsd/jsd_hook.cpp | 28 +- js/jsd/jsd_java.cpp | 6 +- js/jsd/jsd_lock.cpp | 4 +- js/jsd/jsd_lock.h | 2 +- js/jsd/jsd_obj.cpp | 2 +- js/jsd/jsd_scpt.cpp | 30 +- js/jsd/jsd_stak.cpp | 36 +- js/jsd/jsd_step.cpp | 12 +- js/jsd/jsd_text.cpp | 16 +- js/jsd/jsd_val.cpp | 32 +- js/jsd/jsd_xpc.cpp | 4 +- js/jsd/jsdebug.cpp | 100 ++-- js/jsd/jsdebug.h | 108 ++-- js/jsd/jshash.cpp | 4 +- js/jsd/jshash.h | 2 +- js/public/CallArgs.h | 4 +- js/public/MemoryMetrics.h | 2 +- js/public/Value.h | 113 ++-- js/src/builtin/BinaryData.cpp | 60 +- js/src/builtin/BinaryData.h | 201 ++++--- js/src/builtin/Object.cpp | 6 +- js/src/builtin/Profilers.cpp | 32 +- js/src/builtin/Profilers.h | 20 +- js/src/builtin/RegExp.cpp | 6 +- js/src/builtin/TestingFunctions.cpp | 2 +- js/src/ctypes/CTypes.cpp | 178 +++--- js/src/ctypes/CTypes.h | 6 +- js/src/gdb/gdb-tests.cpp | 2 +- js/src/ion/IonBuilder.cpp | 2 +- js/src/ion/IonCaches.cpp | 6 +- js/src/ion/x64/Trampoline-x64.cpp | 2 +- js/src/jsapi-tests/README | 2 +- .../jsapi-tests/testAddPropertyPropcache.cpp | 2 +- js/src/jsapi-tests/testChromeBuffer.cpp | 2 +- js/src/jsapi-tests/testClassGetter.cpp | 2 +- js/src/jsapi-tests/testContexts.cpp | 2 +- js/src/jsapi-tests/testCustomIterator.cpp | 2 +- js/src/jsapi-tests/testDebugger.cpp | 12 +- .../testDefineGetterSetterNonEnumerable.cpp | 2 +- js/src/jsapi-tests/testFuncCallback.cpp | 2 +- js/src/jsapi-tests/testGCFinalizeCallback.cpp | 2 +- js/src/jsapi-tests/testGCOutOfMemory.cpp | 2 +- js/src/jsapi-tests/testGetPropertyDefault.cpp | 2 +- js/src/jsapi-tests/testIndexToString.cpp | 2 +- js/src/jsapi-tests/testIntern.cpp | 2 +- js/src/jsapi-tests/testJSEvaluateScript.cpp | 2 +- js/src/jsapi-tests/testLookup.cpp | 4 +- js/src/jsapi-tests/testLooselyEqual.cpp | 4 +- js/src/jsapi-tests/testOps.cpp | 2 +- js/src/jsapi-tests/testParseJSON.cpp | 2 +- js/src/jsapi-tests/testProfileStrings.cpp | 2 +- js/src/jsapi-tests/testPropCache.cpp | 2 +- js/src/jsapi-tests/testResolveRecursion.cpp | 2 +- js/src/jsapi-tests/testSameValue.cpp | 2 +- js/src/jsapi-tests/testSetProperty.cpp | 2 +- js/src/jsapi-tests/testSlowScript.cpp | 4 +- js/src/jsapi-tests/testSourcePolicy.cpp | 6 +- js/src/jsapi-tests/testValueABI.cpp | 4 +- js/src/jsapi-tests/testXDR.cpp | 4 +- js/src/jsapi-tests/tests.h | 4 +- js/src/jsapi-tests/valueABI.c | 2 +- js/src/jsapi.cpp | 480 ++++++++-------- js/src/jsapi.h | 512 +++++++++--------- js/src/jsarray.cpp | 66 +-- js/src/jsarray.h | 10 +- js/src/jsatom.cpp | 2 +- js/src/jsatom.h | 2 +- js/src/jsbool.cpp | 2 +- js/src/jsbool.h | 2 +- js/src/jsclass.h | 62 +-- js/src/jsclone.cpp | 4 +- js/src/jsclone.h | 4 +- js/src/jscntxt.cpp | 20 +- js/src/jscntxt.h | 12 +- js/src/jscntxtinlines.h | 8 +- js/src/jsdate.cpp | 28 +- js/src/jsdbgapi.cpp | 70 ++- js/src/jsdbgapi.h | 66 ++- js/src/jsdtoa.cpp | 2 +- js/src/jsexn.cpp | 10 +- js/src/jsexn.h | 4 +- js/src/jsfriendapi.cpp | 14 +- js/src/jsfriendapi.h | 64 +-- js/src/jsfun.cpp | 10 +- js/src/jsfun.h | 2 +- js/src/jsgc.cpp | 12 +- js/src/jsgc.h | 12 +- js/src/jsiter.cpp | 16 +- js/src/jsiter.h | 2 +- js/src/jsmath.cpp | 2 +- js/src/jsnum.cpp | 4 +- js/src/jsnum.h | 2 +- js/src/jsobj.cpp | 128 ++--- js/src/jsobj.h | 246 ++++----- js/src/jsobjinlines.h | 24 +- js/src/json.cpp | 18 +- js/src/json.h | 2 +- js/src/jsopcode.cpp | 24 +- js/src/jsopcode.h | 6 +- js/src/jsproxy.cpp | 86 +-- js/src/jsprvtd.h | 4 +- js/src/jspubtd.h | 6 +- js/src/jsstr.cpp | 10 +- js/src/jstypes.h | 10 - js/src/jsweakmap.cpp | 2 +- js/src/jswrapper.cpp | 2 +- js/src/perf/jsperf.cpp | 2 +- js/src/shell/js.cpp | 98 ++-- js/src/vm/ArgumentsObject.cpp | 28 +- js/src/vm/Debugger.cpp | 6 +- js/src/vm/Debugger.h | 6 +- js/src/vm/Interpreter.cpp | 18 +- js/src/vm/ScopeObject.cpp | 64 +-- js/src/vm/TypedArrayObject.cpp | 166 +++--- js/src/vm/TypedArrayObject.h | 198 +++---- js/xpconnect/shell/xpcshell.cpp | 38 +- js/xpconnect/src/XPCCallContext.cpp | 2 +- js/xpconnect/src/XPCComponents.cpp | 38 +- js/xpconnect/src/XPCConvert.cpp | 38 +- js/xpconnect/src/XPCDebug.cpp | 12 +- js/xpconnect/src/XPCException.cpp | 4 +- js/xpconnect/src/XPCInlines.h | 38 +- js/xpconnect/src/XPCJSContextStack.cpp | 4 +- js/xpconnect/src/XPCJSID.cpp | 2 +- js/xpconnect/src/XPCJSRuntime.cpp | 8 +- js/xpconnect/src/XPCLocale.cpp | 14 +- js/xpconnect/src/XPCMaps.cpp | 2 +- js/xpconnect/src/XPCMaps.h | 4 +- js/xpconnect/src/XPCQuickStubs.cpp | 32 +- js/xpconnect/src/XPCQuickStubs.h | 48 +- js/xpconnect/src/XPCRuntimeService.cpp | 2 +- js/xpconnect/src/XPCStack.cpp | 4 +- js/xpconnect/src/XPCThrower.cpp | 10 +- js/xpconnect/src/XPCVariant.cpp | 12 +- js/xpconnect/src/XPCWrappedJS.cpp | 2 +- js/xpconnect/src/XPCWrappedJSClass.cpp | 24 +- js/xpconnect/src/XPCWrappedNative.cpp | 92 ++-- js/xpconnect/src/XPCWrappedNativeInfo.cpp | 8 +- js/xpconnect/src/XPCWrappedNativeJSOps.cpp | 94 ++-- js/xpconnect/src/XPCWrappedNativeProto.cpp | 4 +- js/xpconnect/src/XPCWrappedNativeScope.cpp | 2 +- js/xpconnect/src/XPCWrapper.cpp | 2 +- js/xpconnect/src/XPCWrapper.h | 2 +- js/xpconnect/src/dictionary_helper_gen.py | 4 +- js/xpconnect/src/nsDOMQS.h | 2 +- js/xpconnect/src/nsXPConnect.cpp | 10 +- js/xpconnect/src/qsgen.py | 4 +- js/xpconnect/src/xpcprivate.h | 400 +++++++------- js/xpconnect/src/xpcpublic.h | 4 +- js/xpconnect/wrappers/AccessCheck.cpp | 2 +- js/xpconnect/wrappers/XrayWrapper.cpp | 14 +- js/xpconnect/wrappers/XrayWrapper.h | 6 +- netwerk/base/src/ProxyAutoConfig.cpp | 6 +- .../http/nsHttpChannelAuthProvider.cpp | 2 - security/manager/ssl/src/nsCrypto.cpp | 2 +- startupcache/test/TestStartupCache.cpp | 2 +- toolkit/components/ctypes/ctypes.cpp | 4 +- toolkit/components/perf/PerfMeasurement.cpp | 4 +- toolkit/components/places/History.cpp | 14 +- toolkit/components/places/PlaceInfo.cpp | 2 +- toolkit/components/telemetry/Telemetry.cpp | 12 +- .../google-breakpad/autotools/compile | 344 +++++++++++- toolkit/xre/nsAppRunner.cpp | 3 - tools/profiler/SaveProfileTask.cpp | 2 +- widget/xpwidgets/GfxInfoCollector.h | 2 +- xpcom/base/CycleCollectedJSRuntime.cpp | 2 +- xpcom/base/CycleCollectedJSRuntime.h | 4 +- 229 files changed, 3078 insertions(+), 2763 deletions(-) mode change 120000 => 100755 toolkit/crashreporter/google-breakpad/autotools/compile diff --git a/caps/include/nsJSPrincipals.h b/caps/include/nsJSPrincipals.h index 8c487e7eb3661..5b63574cf4362 100644 --- a/caps/include/nsJSPrincipals.h +++ b/caps/include/nsJSPrincipals.h @@ -13,7 +13,7 @@ class nsCString; struct nsJSPrincipals : nsIPrincipal, JSPrincipals { - static JSBool Subsume(JSPrincipals *jsprin, JSPrincipals *other); + static bool Subsume(JSPrincipals *jsprin, JSPrincipals *other); static void Destroy(JSPrincipals *jsprin); /* diff --git a/caps/include/nsScriptSecurityManager.h b/caps/include/nsScriptSecurityManager.h index d9b47ec8b1136..8b6fa009e049f 100644 --- a/caps/include/nsScriptSecurityManager.h +++ b/caps/include/nsScriptSecurityManager.h @@ -371,13 +371,13 @@ class nsScriptSecurityManager : public nsIScriptSecurityManager, bool SubjectIsPrivileged(); - static JSBool + static bool CheckObjectAccess(JSContext *cx, JS::Handle obj, JS::Handle id, JSAccessMode mode, JS::MutableHandle vp); // Decides, based on CSP, whether or not eval() and stuff can be executed. - static JSBool + static bool ContentSecurityPolicyPermitsJSAction(JSContext *cx); // Returns null if a principal cannot be found; generally callers diff --git a/caps/src/nsJSPrincipals.cpp b/caps/src/nsJSPrincipals.cpp index 111e583e62f34..473f7f3c8c895 100644 --- a/caps/src/nsJSPrincipals.cpp +++ b/caps/src/nsJSPrincipals.cpp @@ -20,7 +20,7 @@ // for mozilla::dom::workers::kJSPrincipalsDebugToken #include "mozilla/dom/workers/Workers.h" -/* static */ JSBool +/* static */ bool nsJSPrincipals::Subsume(JSPrincipals *jsprin, JSPrincipals *other) { bool result; diff --git a/caps/src/nsScriptSecurityManager.cpp b/caps/src/nsScriptSecurityManager.cpp index d621bd8e4c037..c5af0550803fc 100644 --- a/caps/src/nsScriptSecurityManager.cpp +++ b/caps/src/nsScriptSecurityManager.cpp @@ -423,7 +423,7 @@ NS_IMPL_ISUPPORTS4(nsScriptSecurityManager, ///////////////// Security Checks ///////////////// -JSBool +bool nsScriptSecurityManager::ContentSecurityPolicyPermitsJSAction(JSContext *cx) { // Get the security manager @@ -483,7 +483,7 @@ nsScriptSecurityManager::ContentSecurityPolicyPermitsJSAction(JSContext *cx) } -JSBool +bool nsScriptSecurityManager::CheckObjectAccess(JSContext *cx, JS::Handle obj, JS::Handle id, JSAccessMode mode, JS::MutableHandle vp) diff --git a/content/base/src/nsFrameMessageManager.cpp b/content/base/src/nsFrameMessageManager.cpp index 8766e0b08687e..3eb22cce90b31 100644 --- a/content/base/src/nsFrameMessageManager.cpp +++ b/content/base/src/nsFrameMessageManager.cpp @@ -316,7 +316,7 @@ nsFrameMessageManager::RemoveDelayedFrameScript(const nsAString& aURL) return NS_OK; } -static JSBool +static bool JSONCreator(const jschar* aBuf, uint32_t aLen, void* aData) { nsAString* result = static_cast(aData); diff --git a/content/xbl/src/nsXBLBinding.cpp b/content/xbl/src/nsXBLBinding.cpp index 4287ec055beb0..1260cdfe12426 100644 --- a/content/xbl/src/nsXBLBinding.cpp +++ b/content/xbl/src/nsXBLBinding.cpp @@ -80,7 +80,7 @@ XBLFinalize(JSFreeOp *fop, JSObject *obj) c->Drop(); } -static JSBool +static bool XBLEnumerate(JSContext *cx, JS::Handle obj) { nsXBLPrototypeBinding* protoBinding = diff --git a/content/xbl/src/nsXBLDocumentInfo.cpp b/content/xbl/src/nsXBLDocumentInfo.cpp index dcc4d472bcafb..ae0aff7136bed 100644 --- a/content/xbl/src/nsXBLDocumentInfo.cpp +++ b/content/xbl/src/nsXBLDocumentInfo.cpp @@ -68,8 +68,8 @@ class nsXBLDocGlobalObject : public nsIScriptGlobalObject // nsIScriptObjectPrincipal methods virtual nsIPrincipal* GetPrincipal(); - static JSBool doCheckAccess(JSContext *cx, JS::Handle obj, - JS::Handle id, uint32_t accessType); + static bool doCheckAccess(JSContext *cx, JS::Handle obj, + JS::Handle id, uint32_t accessType); NS_DECL_CYCLE_COLLECTION_CLASS_AMBIGUOUS(nsXBLDocGlobalObject, nsIScriptGlobalObject) @@ -90,7 +90,7 @@ class nsXBLDocGlobalObject : public nsIScriptGlobalObject static JSClass gSharedGlobalClass; }; -JSBool +bool nsXBLDocGlobalObject::doCheckAccess(JSContext *cx, JS::Handle obj, JS::Handle id, uint32_t accessType) { @@ -118,7 +118,7 @@ nsXBLDocGlobalObject::doCheckAccess(JSContext *cx, JS::Handle obj, return NS_SUCCEEDED(rv); } -static JSBool +static bool nsXBLDocGlobalObject_getProperty(JSContext *cx, JS::Handle obj, JS::Handle id, JS::MutableHandle vp) { @@ -126,15 +126,15 @@ nsXBLDocGlobalObject_getProperty(JSContext *cx, JS::Handle obj, doCheckAccess(cx, obj, id, nsIXPCSecurityManager::ACCESS_GET_PROPERTY); } -static JSBool +static bool nsXBLDocGlobalObject_setProperty(JSContext *cx, JS::Handle obj, - JS::Handle id, JSBool strict, JS::MutableHandle vp) + JS::Handle id, bool strict, JS::MutableHandle vp) { return nsXBLDocGlobalObject:: doCheckAccess(cx, obj, id, nsIXPCSecurityManager::ACCESS_SET_PROPERTY); } -static JSBool +static bool nsXBLDocGlobalObject_checkAccess(JSContext *cx, JS::Handle obj, JS::Handle id, JSAccessMode mode, JS::MutableHandle vp) { @@ -163,10 +163,10 @@ nsXBLDocGlobalObject_finalize(JSFreeOp *fop, JSObject *obj) NS_RELEASE(nativeThis); } -static JSBool +static bool nsXBLDocGlobalObject_resolve(JSContext *cx, JS::Handle obj, JS::Handle id) { - JSBool did_resolve = false; + bool did_resolve = false; return JS_ResolveStandardClass(cx, obj, id, &did_resolve); } diff --git a/content/xbl/src/nsXBLProtoImpl.cpp b/content/xbl/src/nsXBLProtoImpl.cpp index 68dfe6b61f53c..68a52831485fa 100644 --- a/content/xbl/src/nsXBLProtoImpl.cpp +++ b/content/xbl/src/nsXBLProtoImpl.cpp @@ -300,7 +300,7 @@ nsXBLProtoImpl::UndefineFields(JSContext *cx, JS::Handle obj) const nsDependentString name(f->GetName()); const jschar* s = reinterpret_cast(name.get()); - JSBool hasProp; + bool hasProp; if (::JS_AlreadyHasOwnUCProperty(cx, obj, s, name.Length(), &hasProp) && hasProp) { bool dummy; diff --git a/content/xbl/src/nsXBLProtoImplField.cpp b/content/xbl/src/nsXBLProtoImplField.cpp index a2eeb0a087bf3..e67e1980a21b8 100644 --- a/content/xbl/src/nsXBLProtoImplField.cpp +++ b/content/xbl/src/nsXBLProtoImplField.cpp @@ -125,7 +125,7 @@ ValueHasISupportsPrivate(const JS::Value &v) // contents of the callee's reserved slots. If the property was defined, // *installed will be true, and idp will be set to the property name that was // defined. -static JSBool +static bool InstallXBLField(JSContext* cx, JS::Handle callee, JS::Handle thisObj, JS::MutableHandle idp, bool* installed) @@ -323,7 +323,7 @@ nsXBLProtoImplField::InstallAccessors(JSContext* aCx, // Properties/Methods have historically taken precendence over fields. We // install members first, so just bounce here if the property is already // defined. - JSBool found = false; + bool found = false; if (!JS_AlreadyHasOwnPropertyById(aCx, aTargetClassObject, id, &found)) return NS_ERROR_FAILURE; if (found) diff --git a/content/xbl/src/nsXBLProtoImplMethod.cpp b/content/xbl/src/nsXBLProtoImplMethod.cpp index 40b48228cbc5a..6bdbcedc1cc59 100644 --- a/content/xbl/src/nsXBLProtoImplMethod.cpp +++ b/content/xbl/src/nsXBLProtoImplMethod.cpp @@ -342,7 +342,7 @@ nsXBLProtoImplAnonymousMethod::Execute(nsIContent* aBoundElement) rv = nsContentUtils::GetSecurityManager()->CheckFunctionAccess(cx, method, thisObject); - JSBool ok = true; + bool ok = true; if (NS_SUCCEEDED(rv)) { JS::Rooted retval(cx); ok = ::JS_CallFunctionValue(cx, thisObject, OBJECT_TO_JSVAL(method), diff --git a/content/xul/document/src/nsXULPrototypeDocument.cpp b/content/xul/document/src/nsXULPrototypeDocument.cpp index 9da35132af4ab..5933fe03f6727 100644 --- a/content/xul/document/src/nsXULPrototypeDocument.cpp +++ b/content/xul/document/src/nsXULPrototypeDocument.cpp @@ -98,10 +98,10 @@ nsXULPDGlobalObject_finalize(JSFreeOp *fop, JSObject *obj) } -JSBool +bool nsXULPDGlobalObject_resolve(JSContext *cx, JS::Handle obj, JS::Handle id) { - JSBool did_resolve = false; + bool did_resolve = false; return JS_ResolveStandardClass(cx, obj, id, &did_resolve); } diff --git a/dom/base/nsDOMClassInfo.cpp b/dom/base/nsDOMClassInfo.cpp index 06a756e920670..057a122d4eab1 100644 --- a/dom/base/nsDOMClassInfo.cpp +++ b/dom/base/nsDOMClassInfo.cpp @@ -2182,7 +2182,7 @@ nsDOMClassInfo::PostCreatePrototype(JSContext * cx, JSObject * aProto) } // Don't overwrite a property set by content. - JSBool found; + bool found; if (!::JS_AlreadyHasOwnUCProperty(cx, global, reinterpret_cast(mData->mNameUTF16), NS_strlen(mData->mNameUTF16), &found)) { return NS_ERROR_FAILURE; @@ -2346,7 +2346,7 @@ static JSClass sGlobalScopePolluterClass = { // static -JSBool +bool nsWindowSH::GlobalScopePolluterGetProperty(JSContext *cx, JS::Handle obj, JS::Handle id, JS::MutableHandle vp) { @@ -2369,7 +2369,7 @@ nsWindowSH::GlobalScopePolluterGetProperty(JSContext *cx, JS::Handle } // Gets a subframe. -static JSBool +static bool ChildWindowGetter(JSContext *cx, JS::Handle obj, JS::Handle id, JS::MutableHandle vp) { @@ -2406,7 +2406,7 @@ GetDocument(JSObject *obj) } // static -JSBool +bool nsWindowSH::GlobalScopePolluterNewResolve(JSContext *cx, JS::Handle obj, JS::Handle id, unsigned flags, JS::MutableHandle objp) @@ -2452,7 +2452,7 @@ nsWindowSH::GlobalScopePolluterNewResolve(JSContext *cx, JS::Handle o if (!::JS_GetPrototype(cx, obj, &proto)) { return false; } - JSBool hasProp; + bool hasProp; if (!proto || !::JS_HasPropertyById(cx, proto, id, &hasProp) || hasProp) { @@ -2503,7 +2503,7 @@ nsWindowSH::GlobalScopePolluterNewResolve(JSContext *cx, JS::Handle o } // static -JSBool +bool nsWindowSH::InvalidateGlobalScopePolluter(JSContext *cx, JS::Handle aObj) { @@ -2861,7 +2861,7 @@ class nsDOMConstructor MOZ_FINAL : public nsIDOMDOMConstructor { JS::Rooted thisAsVal(cx, aThisAsVal); // The 'attrs' argument used to be JSPROP_PERMANENT. See bug 628612. - JSBool ok = JS_WrapValue(cx, thisAsVal.address()) && + bool ok = JS_WrapValue(cx, thisAsVal.address()) && ::JS_DefineUCProperty(cx, target, reinterpret_cast(mClassName), NS_strlen(mClassName), thisAsVal, JS_PropertyStub, @@ -3763,9 +3763,9 @@ nsWindowSH::GlobalResolve(nsGlobalWindow *aWin, JSContext *cx, return NS_ERROR_UNEXPECTED; } - JSBool ok = ::JS_DefinePropertyById(cx, obj, id, prop_val, - JS_PropertyStub, JS_StrictPropertyStub, - JSPROP_ENUMERATE); + bool ok = ::JS_DefinePropertyById(cx, obj, id, prop_val, + JS_PropertyStub, JS_StrictPropertyStub, + JSPROP_ENUMERATE); *did_resolve = true; @@ -3850,8 +3850,8 @@ LocationSetterGuts(JSContext *cx, JSObject *obj, jsval *vp) } template -static JSBool -LocationSetter(JSContext *cx, JS::Handle obj, JS::Handle id, JSBool strict, +static bool +LocationSetter(JSContext *cx, JS::Handle obj, JS::Handle id, bool strict, JS::MutableHandle vp) { nsresult rv = LocationSetterGuts(cx, obj, vp.address()); @@ -3863,9 +3863,9 @@ LocationSetter(JSContext *cx, JS::Handle obj, JS::Handle id, JS return true; } -static JSBool +static bool LocationSetterUnwrapper(JSContext *cx, JS::Handle obj_, JS::Handle id, - JSBool strict, JS::MutableHandle vp) + bool strict, JS::MutableHandle vp) { JS::RootedObject obj(cx, obj_); @@ -3990,8 +3990,8 @@ nsWindowSH::NewResolve(nsIXPConnectWrappedNative *wrapper, JSContext *cx, // Don't resolve standard classes on XrayWrappers, only resolve them if we're // resolving on the real global object. if (!xpc::WrapperFactory::IsXrayWrapper(obj)) { - JSBool did_resolve = false; - JSBool ok = true; + bool did_resolve = false; + bool ok = true; JS::Rooted exn(cx, JSVAL_VOID); { @@ -4068,7 +4068,7 @@ nsWindowSH::NewResolve(nsIXPConnectWrappedNative *wrapper, JSContext *cx, v.address(), getter_AddRefs(holder)); NS_ENSURE_SUCCESS(rv, rv); - JSBool ok = JS_WrapValue(cx, v.address()) && + bool ok = JS_WrapValue(cx, v.address()) && JS_DefinePropertyById(cx, obj, id, v, JS_PropertyStub, LocationSetterUnwrapper, JSPROP_PERMANENT | JSPROP_ENUMERATE); @@ -4517,7 +4517,7 @@ nsGenericArraySH::Enumerate(nsIXPConnectWrappedNative *wrapper, JSContext *cx, sCurrentlyEnumerating = true; JS::Rooted len_val(cx); - JSBool ok = ::JS_GetProperty(cx, obj, "length", &len_val); + bool ok = ::JS_GetProperty(cx, obj, "length", &len_val); if (ok && JSVAL_IS_INT(len_val)) { int32_t length = JSVAL_TO_INT(len_val); @@ -4613,7 +4613,7 @@ JSClass sHTMLDocumentAllClass = { // static -JSBool +bool nsHTMLDocumentSH::GetDocumentAllNodeList(JSContext *cx, JS::Handle obj, nsDocument *domdoc, @@ -4679,7 +4679,7 @@ nsHTMLDocumentSH::GetDocumentAllNodeList(JSContext *cx, return *nodeList != nullptr; } -JSBool +bool nsHTMLDocumentSH::DocumentAllGetProperty(JSContext *cx, JS::Handle obj_, JS::Handle id, JS::MutableHandle vp) { @@ -4776,7 +4776,7 @@ nsHTMLDocumentSH::DocumentAllGetProperty(JSContext *cx, JS::Handle ob return true; } -JSBool +bool nsHTMLDocumentSH::DocumentAllNewResolve(JSContext *cx, JS::Handle obj, JS::Handle id, unsigned flags, JS::MutableHandle objp) @@ -4806,7 +4806,7 @@ nsHTMLDocumentSH::DocumentAllNewResolve(JSContext *cx, JS::Handle obj } } - JSBool ok = true; + bool ok = true; if (v.get() != JSVAL_VOID) { ok = ::JS_DefinePropertyById(cx, obj, id, v, nullptr, nullptr, 0); @@ -5052,7 +5052,7 @@ nsStorage2SH::NewResolve(nsIXPConnectWrappedNative *wrapper, JSContext *cx, if (!::JS_GetPrototype(cx, realObj, &proto)) { return NS_ERROR_FAILURE; } - JSBool hasProp; + bool hasProp; if (proto && (::JS_HasPropertyById(cx, proto, id, &hasProp) && @@ -5298,7 +5298,7 @@ nsDOMConstructorSH::NewResolve(nsIXPConnectWrappedNative *wrapper, JSContext *cx // looked-for constant. Note that we don't have to worry about infinitely // recurring back here because the Xray wrapper's holder object doesn't call // NewResolve hooks. - JSBool found; + bool found; if (!JS_HasPropertyById(cx, nativePropsObj, id, &found)) { *_retval = false; return NS_OK; diff --git a/dom/base/nsDOMClassInfo.h b/dom/base/nsDOMClassInfo.h index c939929fb894f..b0e3fad001aa0 100644 --- a/dom/base/nsDOMClassInfo.h +++ b/dom/base/nsDOMClassInfo.h @@ -333,13 +333,13 @@ class nsWindowSH : public nsDOMGenericSH NS_IMETHOD OuterObject(nsIXPConnectWrappedNative *wrapper, JSContext * cx, JSObject * obj, JSObject * *_retval) MOZ_OVERRIDE; - static JSBool GlobalScopePolluterNewResolve(JSContext *cx, JS::Handle obj, - JS::Handle id, unsigned flags, - JS::MutableHandle objp); - static JSBool GlobalScopePolluterGetProperty(JSContext *cx, JS::Handle obj, - JS::Handle id, JS::MutableHandle vp); - static JSBool InvalidateGlobalScopePolluter(JSContext *cx, - JS::Handle obj); + static bool GlobalScopePolluterNewResolve(JSContext *cx, JS::Handle obj, + JS::Handle id, unsigned flags, + JS::MutableHandle objp); + static bool GlobalScopePolluterGetProperty(JSContext *cx, JS::Handle obj, + JS::Handle id, JS::MutableHandle vp); + static bool InvalidateGlobalScopePolluter(JSContext *cx, + JS::Handle obj); static nsresult InstallGlobalScopePolluter(JSContext *cx, JS::Handle obj); static nsIClassInfo *doCreate(nsDOMClassInfoData* aData) @@ -443,14 +443,14 @@ extern JSClass sHTMLDocumentAllClass; class nsHTMLDocumentSH { protected: - static JSBool GetDocumentAllNodeList(JSContext *cx, JS::Handle obj, - nsDocument *doc, - nsContentList **nodeList); + static bool GetDocumentAllNodeList(JSContext *cx, JS::Handle obj, + nsDocument *doc, + nsContentList **nodeList); public: - static JSBool DocumentAllGetProperty(JSContext *cx, JS::Handle obj, JS::Handle id, - JS::MutableHandle vp); - static JSBool DocumentAllNewResolve(JSContext *cx, JS::Handle obj, JS::Handle id, - unsigned flags, JS::MutableHandle objp); + static bool DocumentAllGetProperty(JSContext *cx, JS::Handle obj, JS::Handle id, + JS::MutableHandle vp); + static bool DocumentAllNewResolve(JSContext *cx, JS::Handle obj, JS::Handle id, + unsigned flags, JS::MutableHandle objp); static void ReleaseDocument(JSFreeOp *fop, JSObject *obj); static bool CallToGetPropMapper(JSContext *cx, unsigned argc, jsval *vp); }; diff --git a/dom/base/nsGlobalWindow.cpp b/dom/base/nsGlobalWindow.cpp index a419678f5b595..b79780601b056 100644 --- a/dom/base/nsGlobalWindow.cpp +++ b/dom/base/nsGlobalWindow.cpp @@ -6736,7 +6736,7 @@ PostMessageReadStructuredClone(JSContext* cx, return nullptr; } -static JSBool +static bool PostMessageWriteStructuredClone(JSContext* cx, JSStructuredCloneWriter* writer, JS::Handle obj, diff --git a/dom/base/nsJSEnvironment.cpp b/dom/base/nsJSEnvironment.cpp index e2aa5bb8f23fe..19b8879986c8c 100644 --- a/dom/base/nsJSEnvironment.cpp +++ b/dom/base/nsJSEnvironment.cpp @@ -694,7 +694,7 @@ GetPromptFromContext(nsJSContext* ctx) return prompt.forget(); } -JSBool +bool nsJSContext::DOMOperationCallback(JSContext *cx) { nsresult rv; @@ -763,7 +763,7 @@ nsJSContext::DOMOperationCallback(JSContext *cx) // Check if we should offer the option to debug JS::RootedScript script(cx); unsigned lineno; - JSBool hasFrame = ::JS_DescribeScriptedCaller(cx, script.address(), &lineno); + bool hasFrame = ::JS_DescribeScriptedCaller(cx, script.address(), &lineno); bool debugPossible = hasFrame && js::CanCallContextDebugHandler(cx); #ifdef MOZ_JSDEBUGGER @@ -3315,7 +3315,7 @@ NS_DOMReadStructuredClone(JSContext* cx, return nullptr; } -JSBool +bool NS_DOMWriteStructuredClone(JSContext* cx, JSStructuredCloneWriter* writer, JS::Handle obj, diff --git a/dom/base/nsJSEnvironment.h b/dom/base/nsJSEnvironment.h index 8794374f49286..28fb7932ad662 100644 --- a/dom/base/nsJSEnvironment.h +++ b/dom/base/nsJSEnvironment.h @@ -206,7 +206,7 @@ class nsJSContext : public nsIScriptContext, static int JSOptionChangedCallback(const char *pref, void *data); - static JSBool DOMOperationCallback(JSContext *cx); + static bool DOMOperationCallback(JSContext *cx); }; class nsIJSRuntimeService; @@ -263,9 +263,9 @@ JSObject* NS_DOMReadStructuredClone(JSContext* cx, JSStructuredCloneReader* reader, uint32_t tag, uint32_t data, void* closure); -JSBool NS_DOMWriteStructuredClone(JSContext* cx, - JSStructuredCloneWriter* writer, - JS::Handle obj, void *closure); +bool NS_DOMWriteStructuredClone(JSContext* cx, + JSStructuredCloneWriter* writer, + JS::Handle obj, void *closure); void NS_DOMStructuredCloneError(JSContext* cx, uint32_t errorid); diff --git a/dom/base/nsJSUtils.cpp b/dom/base/nsJSUtils.cpp index 206bd68e83b6e..5de45b655aeaa 100644 --- a/dom/base/nsJSUtils.cpp +++ b/dom/base/nsJSUtils.cpp @@ -30,7 +30,7 @@ #include "mozilla/dom/BindingUtils.h" -JSBool +bool nsJSUtils::GetCallingLocation(JSContext* aContext, const char* *aFilename, uint32_t* aLineno) { diff --git a/dom/base/nsJSUtils.h b/dom/base/nsJSUtils.h index 602f777b11629..d176ce280f1f3 100644 --- a/dom/base/nsJSUtils.h +++ b/dom/base/nsJSUtils.h @@ -27,8 +27,8 @@ class nsIPrincipal; class nsJSUtils { public: - static JSBool GetCallingLocation(JSContext* aContext, const char* *aFilename, - uint32_t* aLineno); + static bool GetCallingLocation(JSContext* aContext, const char* *aFilename, + uint32_t* aLineno); static nsIScriptGlobalObject *GetStaticScriptGlobal(JSObject* aObj); @@ -99,7 +99,7 @@ class nsDependentJSString : public nsDependentString { } - JSBool init(JSContext* aContext, JSString* str) + bool init(JSContext* aContext, JSString* str) { size_t length; const jschar* chars = JS_GetStringCharsZAndLength(aContext, str, &length); @@ -112,7 +112,7 @@ class nsDependentJSString : public nsDependentString return true; } - JSBool init(JSContext* aContext, const JS::Value &v) + bool init(JSContext* aContext, const JS::Value &v) { return init(aContext, JSVAL_TO_STRING(v)); } diff --git a/dom/base/nsStructuredCloneContainer.cpp b/dom/base/nsStructuredCloneContainer.cpp index 2c5afe26d9a02..61aedabaeee07 100644 --- a/dom/base/nsStructuredCloneContainer.cpp +++ b/dom/base/nsStructuredCloneContainer.cpp @@ -112,7 +112,7 @@ nsStructuredCloneContainer::DeserializeToVariant(JSContext *aCx, // Deserialize to a JS::Value. JS::Rooted jsStateObj(aCx); - JSBool hasTransferable = false; + bool hasTransferable = false; bool success = JS_ReadStructuredClone(aCx, mData, mSize, mVersion, jsStateObj.address(), nullptr, nullptr) && JS_StructuredCloneHasTransferables(mData, mSize, diff --git a/dom/bindings/BindingUtils.cpp b/dom/bindings/BindingUtils.cpp index 348875d34508f..40b8959274787 100644 --- a/dom/bindings/BindingUtils.cpp +++ b/dom/bindings/BindingUtils.cpp @@ -217,7 +217,7 @@ DefineConstants(JSContext* cx, JS::Handle obj, const ConstantSpec* cs) { for (; cs->name; ++cs) { - JSBool ok = + bool ok = JS_DefineProperty(cx, obj, cs->name, cs->value, NULL, NULL, JSPROP_ENUMERATE | JSPROP_READONLY | JSPROP_PERMANENT); if (!ok) { @@ -351,7 +351,7 @@ static bool DefineConstructor(JSContext* cx, JS::Handle global, const char* name, JS::Handle constructor) { - JSBool alreadyDefined; + bool alreadyDefined; if (!JS_AlreadyHasOwnProperty(cx, global, name, &alreadyDefined)) { return false; } @@ -672,7 +672,7 @@ TryPreserveWrapper(JSObject* obj) // Can only be called with the immediate prototype of the instance object. Can // only be called on the prototype of an object known to be a DOM instance. -JSBool +bool InstanceClassHasProtoAtDepth(JS::Handle protoObject, uint32_t protoID, uint32_t depth) { @@ -1316,7 +1316,7 @@ GetPropertyOnPrototype(JSContext* cx, JS::Handle proxy, return true; } - JSBool hasProp; + bool hasProp; if (!JS_HasPropertyById(cx, proto, id, &hasProp)) { return false; } @@ -1730,10 +1730,10 @@ WorkerGlobalObject::WorkerGlobalObject(JSContext* aCx, JSObject* aObject) mGlobalJSObject = GetGlobalObject(aCx, aObject, ac); } -JSBool +bool InterfaceHasInstance(JSContext* cx, JS::Handle obj, JS::Handle instance, - JSBool* bp) + bool* bp) { const DOMIfaceAndProtoJSClass* clasp = DOMIfaceAndProtoJSClass::FromJSClass(js::GetObjectClass(obj)); @@ -1789,9 +1789,9 @@ InterfaceHasInstance(JSContext* cx, JS::Handle obj, return true; } -JSBool +bool InterfaceHasInstance(JSContext* cx, JS::Handle obj, JS::MutableHandle vp, - JSBool* bp) + bool* bp) { if (!vp.isObject()) { *bp = false; @@ -1802,10 +1802,10 @@ InterfaceHasInstance(JSContext* cx, JS::Handle obj, JS::MutableHandle return InterfaceHasInstance(cx, obj, instanceObject, bp); } -JSBool +bool InterfaceHasInstance(JSContext* cx, int prototypeID, int depth, JS::Handle instance, - JSBool* bp) + bool* bp) { const DOMClass* domClass = GetDOMClass(js::UncheckedUnwrap(instance)); diff --git a/dom/bindings/BindingUtils.h b/dom/bindings/BindingUtils.h index 7ee25bb63aead..fdb1ca4efc75c 100644 --- a/dom/bindings/BindingUtils.h +++ b/dom/bindings/BindingUtils.h @@ -984,7 +984,7 @@ TryPreserveWrapper(JSObject* obj); // Can only be called with the immediate prototype of the instance object. Can // only be called on the prototype of an object known to be a DOM instance. -JSBool +bool InstanceClassHasProtoAtDepth(JS::Handle protoObject, uint32_t protoID, uint32_t depth); @@ -2093,17 +2093,17 @@ ReparentWrapper(JSContext* aCx, JS::HandleObject aObj); * * instance should not be a security wrapper. */ -JSBool +bool InterfaceHasInstance(JSContext* cx, JS::Handle obj, JS::Handle instance, - JSBool* bp); -JSBool + bool* bp); +bool InterfaceHasInstance(JSContext* cx, JS::Handle obj, JS::MutableHandle vp, - JSBool* bp); -JSBool + bool* bp); +bool InterfaceHasInstance(JSContext* cx, int prototypeID, int depth, JS::Handle instance, - JSBool* bp); + bool* bp); // Helper for lenient getters/setters to report to console. If this // returns false, we couldn't even get a global. diff --git a/dom/bindings/Codegen.py b/dom/bindings/Codegen.py index a5d688c4c2442..74fd8d855b1b8 100644 --- a/dom/bindings/Codegen.py +++ b/dom/bindings/Codegen.py @@ -962,7 +962,7 @@ def __init__(self, descriptor): args = [Argument('JSContext*', 'cx'), Argument('JS::Handle', 'obj'), Argument('JS::Handle', 'id'), Argument('JS::MutableHandle', 'vp')] CGAbstractClassHook.__init__(self, descriptor, ADDPROPERTY_HOOK_NAME, - 'JSBool', args) + 'bool', args) def generate_code(self): assert not self.descriptor.workers and self.descriptor.wrapperCache @@ -1152,9 +1152,9 @@ def define(self): class CGClassHasInstanceHook(CGAbstractStaticMethod): def __init__(self, descriptor): args = [Argument('JSContext*', 'cx'), Argument('JS::Handle', 'obj'), - Argument('JS::MutableHandle', 'vp'), Argument('JSBool*', 'bp')] + Argument('JS::MutableHandle', 'vp'), Argument('bool*', 'bp')] CGAbstractStaticMethod.__init__(self, descriptor, HASINSTANCE_HOOK_NAME, - 'JSBool', args) + 'bool', args) def define(self): if not NeedsGeneratedHasInstance(self.descriptor): @@ -5205,9 +5205,8 @@ class CGAbstractBindingMethod(CGAbstractStaticMethod): """ def __init__(self, descriptor, name, args, unwrapFailureCode=None, getThisObj="args.computeThis(cx).toObjectOrNull()", - callArgs="JS::CallArgs args = JS::CallArgsFromVp(argc, vp);", - returnType="bool"): - CGAbstractStaticMethod.__init__(self, descriptor, name, returnType, args) + callArgs="JS::CallArgs args = JS::CallArgsFromVp(argc, vp);"): + CGAbstractStaticMethod.__init__(self, descriptor, name, "bool", args) if unwrapFailureCode is None: self.unwrapFailureCode = 'return ThrowErrorMessage(cx, MSG_THIS_DOES_NOT_IMPLEMENT_INTERFACE, "Value", "%s");' % descriptor.interface.identifier.name @@ -5374,7 +5373,7 @@ def __init__(self, descriptor): # Our "self" is actually the "obj" argument in this case, not the thisval. CGAbstractBindingMethod.__init__( self, descriptor, NEWRESOLVE_HOOK_NAME, - args, getThisObj="", callArgs="", returnType="JSBool") + args, getThisObj="", callArgs="") def generate_code(self): return CGIndenter(CGGeneric( @@ -5402,7 +5401,7 @@ def __init__(self, descriptor): # Our "self" is actually the "obj" argument in this case, not the thisval. CGAbstractBindingMethod.__init__( self, descriptor, ENUMERATE_HOOK_NAME, - args, getThisObj="", callArgs="", returnType="JSBool") + args, getThisObj="", callArgs="") def generate_code(self): return CGIndenter(CGGeneric( @@ -7423,13 +7422,13 @@ def getBody(self): "}\n") % self.descriptor.name if UseHolderForUnforgeable(self.descriptor): - defineOnUnforgeable = ("JSBool hasUnforgeable;\n" + defineOnUnforgeable = ("bool hasUnforgeable;\n" "if (!JS_HasPropertyById(cx, ${holder}, id, &hasUnforgeable)) {\n" " return false;\n" "}\n" "if (hasUnforgeable) {\n" " *defined = true;" + - " JSBool unused;\n" + " bool unused;\n" " return js_DefineOwnProperty(cx, ${holder}, id, *desc, &unused);\n" "}\n") set += CallOnUnforgeableHolder(self.descriptor, @@ -7514,7 +7513,7 @@ def getDeleterBody(type): "}\n") % self.descriptor.nativeType if UseHolderForUnforgeable(self.descriptor): - unforgeable = ("JSBool hasUnforgeable;\n" + unforgeable = ("bool hasUnforgeable;\n" "if (!JS_HasPropertyById(cx, ${holder}, id, &hasUnforgeable)) {\n" " return false;\n" "}\n" @@ -7620,8 +7619,8 @@ def getBody(self): indexed = "" if UseHolderForUnforgeable(self.descriptor): - unforgeable = ("JSBool b = true;\n" - "JSBool ok = JS_AlreadyHasOwnPropertyById(cx, ${holder}, id, &b);\n" + unforgeable = ("bool b = true;\n" + "bool ok = JS_AlreadyHasOwnPropertyById(cx, ${holder}, id, &b);\n" "*bp = !!b;\n" "if (!ok || *bp) {\n" " return ok;\n" @@ -7649,8 +7648,8 @@ def getBody(self): """ + indexed + unforgeable + """ JS::Rooted expando(cx, GetExpandoObject(proxy)); if (expando) { - JSBool b = true; - JSBool ok = JS_HasPropertyById(cx, expando, id, &b); + bool b = true; + bool ok = JS_HasPropertyById(cx, expando, id, &b); *bp = !!b; if (!ok || *bp) { return ok; @@ -7672,7 +7671,7 @@ def __init__(self, descriptor): def getBody(self): if UseHolderForUnforgeable(self.descriptor): hasUnforgeable = ( - "JSBool hasUnforgeable;\n" + "bool hasUnforgeable;\n" "if (!JS_AlreadyHasOwnPropertyById(cx, ${holder}, id, &hasUnforgeable)) {\n" " return false;\n" "}\n" @@ -7685,7 +7684,7 @@ def getBody(self): getUnforgeableOrExpando = "" getUnforgeableOrExpando += """JS::Rooted expando(cx, DOMProxyHandler::GetExpandoObject(proxy)); if (expando) { - JSBool hasProp; + bool hasProp; if (!JS_HasPropertyById(cx, expando, id, &hasProp)) { return false; } @@ -7795,7 +7794,7 @@ def getBody(self): JS::Rooted expando(cx, GetExpandoObject(proxy)); if (expando) { - JSBool isPresent; + bool isPresent; if (!JS_GetElementIfPresent(cx, expando, index, expando, vp, &isPresent)) { return false; } @@ -7815,7 +7814,7 @@ def getBody(self): return false; } if (proto) { - JSBool isPresent; + bool isPresent; if (!JS_GetElementIfPresent(cx, proto, index, proxy, vp, &isPresent)) { return false; } diff --git a/dom/bindings/DOMJSProxyHandler.cpp b/dom/bindings/DOMJSProxyHandler.cpp index 1777694917b81..cdf5f7b8f4400 100644 --- a/dom/bindings/DOMJSProxyHandler.cpp +++ b/dom/bindings/DOMJSProxyHandler.cpp @@ -40,7 +40,7 @@ DOMProxyShadows(JSContext* cx, JS::Handle proxy, JS::Handle id) { JS::Value v = js::GetProxyExtra(proxy, JSPROXYSLOT_EXPANDO); if (v.isObject()) { - JSBool hasOwn; + bool hasOwn; if (!JS_AlreadyHasOwnPropertyById(cx, &v.toObject(), id, &hasOwn)) return js::ShadowCheckFailed; @@ -203,7 +203,7 @@ DOMProxyHandler::defineProperty(JSContext* cx, JS::Handle proxy, JS:: return false; } - JSBool dummy; + bool dummy; return js_DefineOwnProperty(cx, expando, id, *desc, &dummy); } @@ -252,7 +252,7 @@ DOMProxyHandler::has(JSContext* cx, JS::Handle proxy, JS::Handle : public DisallowedConversion {} template<> struct PrimitiveConversionTraits { - typedef JSBool jstype; + typedef bool jstype; typedef bool intermediateType; static inline bool converter(JSContext* /* unused */, JS::Handle v, jstype* retval) { diff --git a/dom/bluetooth/BluetoothHfpManager.cpp b/dom/bluetooth/BluetoothHfpManager.cpp index 80799dc03a847..cee8581047580 100644 --- a/dom/bluetooth/BluetoothHfpManager.cpp +++ b/dom/bluetooth/BluetoothHfpManager.cpp @@ -547,7 +547,7 @@ BluetoothHfpManager::HandleVolumeChanged(const nsAString& aData) return; } - JSBool match; + bool match; if (!JS_StringEqualsAscii(cx, key.toString(), AUDIO_VOLUME_BT_SCO_ID, &match) || !match) { return; diff --git a/dom/bluetooth/BluetoothService.cpp b/dom/bluetooth/BluetoothService.cpp index b5b8c5f6d7104..18a54eeab40e3 100644 --- a/dom/bluetooth/BluetoothService.cpp +++ b/dom/bluetooth/BluetoothService.cpp @@ -583,7 +583,7 @@ BluetoothService::HandleSettingsChanged(const nsAString& aData) } // First, check if the string equals to BLUETOOTH_DEBUGGING_SETTING - JSBool match; + bool match; if (!JS_StringEqualsAscii(cx, key.toString(), BLUETOOTH_DEBUGGING_SETTING, &match)) { MOZ_ASSERT(!JS_IsExceptionPending(cx)); return NS_ERROR_OUT_OF_MEMORY; diff --git a/dom/indexedDB/IDBKeyRange.cpp b/dom/indexedDB/IDBKeyRange.cpp index c370f7f7136c9..bba1569637466 100644 --- a/dom/indexedDB/IDBKeyRange.cpp +++ b/dom/indexedDB/IDBKeyRange.cpp @@ -135,7 +135,7 @@ MakeLowerBoundKeyRange(JSContext* aCx, NS_ASSERTION(NS_IsMainThread(), "Wrong thread!"); JS::Rooted val(aCx); - JSBool open = false; + bool open = false; if (!JS_ConvertArguments(aCx, aArgc, JS_ARGV(aCx, aVp), "v/b", val.address(), &open)) { return false; @@ -158,7 +158,7 @@ MakeUpperBoundKeyRange(JSContext* aCx, NS_ASSERTION(NS_IsMainThread(), "Wrong thread!"); JS::Rooted val(aCx); - JSBool open = false; + bool open = false; if (!JS_ConvertArguments(aCx, aArgc, JS_ARGV(aCx, aVp), "v/b", val.address(), &open)) { return false; @@ -181,7 +181,7 @@ MakeBoundKeyRange(JSContext* aCx, NS_ASSERTION(NS_IsMainThread(), "Wrong thread!"); JS::Rooted lowerVal(aCx), upperVal(aCx); - JSBool lowerOpen = false, upperOpen = false; + bool lowerOpen = false, upperOpen = false; if (!JS_ConvertArguments(aCx, aArgc, JS_ARGV(aCx, aVp), "vv/bb", lowerVal.address(), upperVal.address(), &lowerOpen, &upperOpen)) { @@ -219,7 +219,7 @@ const JSFunctionSpec gKeyRangeConstructors[] = { } // anonymous namespace // static -JSBool +bool IDBKeyRange::DefineConstructors(JSContext* aCx, JSObject* aObject) { diff --git a/dom/indexedDB/IDBKeyRange.h b/dom/indexedDB/IDBKeyRange.h index 9ccf93aa330cb..9b80b75f5f913 100644 --- a/dom/indexedDB/IDBKeyRange.h +++ b/dom/indexedDB/IDBKeyRange.h @@ -29,8 +29,8 @@ class IDBKeyRange MOZ_FINAL : public nsIIDBKeyRange NS_DECL_NSIIDBKEYRANGE NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(IDBKeyRange) - static JSBool DefineConstructors(JSContext* aCx, - JSObject* aObject); + static bool DefineConstructors(JSContext* aCx, + JSObject* aObject); static nsresult FromJSVal(JSContext* aCx, const jsval& aVal, diff --git a/dom/indexedDB/IDBObjectStore.cpp b/dom/indexedDB/IDBObjectStore.cpp index fa53547bb944e..aad2bde6b200e 100644 --- a/dom/indexedDB/IDBObjectStore.cpp +++ b/dom/indexedDB/IDBObjectStore.cpp @@ -1471,7 +1471,7 @@ IDBObjectStore::StructuredCloneReadCallback(JSContext* aCx, } // static -JSBool +bool IDBObjectStore::StructuredCloneWriteCallback(JSContext* aCx, JSStructuredCloneWriter* aWriter, JS::Handle aObj, diff --git a/dom/indexedDB/IDBObjectStore.h b/dom/indexedDB/IDBObjectStore.h index bd4fba9673b24..1ef1c69a02705 100644 --- a/dom/indexedDB/IDBObjectStore.h +++ b/dom/indexedDB/IDBObjectStore.h @@ -108,7 +108,7 @@ class IDBObjectStore MOZ_FINAL : public nsISupports, uint32_t aTag, uint32_t aData, void* aClosure); - static JSBool + static bool StructuredCloneWriteCallback(JSContext* aCx, JSStructuredCloneWriter* aWriter, JS::Handle aObj, diff --git a/dom/indexedDB/IndexedDatabaseManager.cpp b/dom/indexedDB/IndexedDatabaseManager.cpp index 1c8b2c21b1bc9..4fef5807d0b9e 100644 --- a/dom/indexedDB/IndexedDatabaseManager.cpp +++ b/dom/indexedDB/IndexedDatabaseManager.cpp @@ -526,7 +526,7 @@ IndexedDatabaseManager::InitWindowless(const jsval& aObj, JSContext* aCx) JS::Rooted obj(aCx, JSVAL_TO_OBJECT(aObj)); - JSBool hasIndexedDB; + bool hasIndexedDB; if (!JS_HasProperty(aCx, obj, "indexedDB", &hasIndexedDB)) { return NS_ERROR_FAILURE; } diff --git a/dom/indexedDB/KeyPath.cpp b/dom/indexedDB/KeyPath.cpp index d6d69206fe0e7..ff574de913d50 100644 --- a/dom/indexedDB/KeyPath.cpp +++ b/dom/indexedDB/KeyPath.cpp @@ -49,7 +49,7 @@ IsValidKeyPathString(JSContext* aCx, const nsAString& aKeyPath) NS_ASSERTION(JSVAL_IS_STRING(stringVal), "This should never happen"); JSString* str = JSVAL_TO_STRING(stringVal); - JSBool isIdentifier = false; + bool isIdentifier = false; if (!JS_IsIdentifier(aCx, str, &isIdentifier) || !isIdentifier) { return false; } @@ -105,21 +105,21 @@ GetJSValFromKeyPathString(JSContext* aCx, const jschar* keyPathChars = token.BeginReading(); const size_t keyPathLen = token.Length(); - JSBool hasProp; + bool hasProp; if (!targetObject) { // We're still walking the chain of existing objects if (!obj) { return NS_ERROR_DOM_INDEXEDDB_DATA_ERR; } - JSBool ok = JS_HasUCProperty(aCx, obj, keyPathChars, keyPathLen, - &hasProp); + bool ok = JS_HasUCProperty(aCx, obj, keyPathChars, keyPathLen, + &hasProp); NS_ENSURE_TRUE(ok, NS_ERROR_DOM_INDEXEDDB_UNKNOWN_ERR); if (hasProp) { // Get if the property exists... JS::Rooted intermediate(aCx); - JSBool ok = JS_GetUCProperty(aCx, obj, keyPathChars, keyPathLen, &intermediate); + bool ok = JS_GetUCProperty(aCx, obj, keyPathChars, keyPathLen, &intermediate); NS_ENSURE_TRUE(ok, NS_ERROR_DOM_INDEXEDDB_UNKNOWN_ERR); // Treat explicitly undefined as an error. diff --git a/dom/ipc/StructuredCloneUtils.cpp b/dom/ipc/StructuredCloneUtils.cpp index 608e535de40fd..39c0507b184e5 100644 --- a/dom/ipc/StructuredCloneUtils.cpp +++ b/dom/ipc/StructuredCloneUtils.cpp @@ -98,7 +98,7 @@ Read(JSContext* aCx, JSStructuredCloneReader* aReader, uint32_t aTag, return NS_DOMReadStructuredClone(aCx, aReader, aTag, aData, nullptr); } -JSBool +bool Write(JSContext* aCx, JSStructuredCloneWriter* aWriter, JS::Handle aObj, void* aClosure) { diff --git a/dom/ipc/TabParent.h b/dom/ipc/TabParent.h index 853a7d20a5dbc..d9ec06abf9be3 100644 --- a/dom/ipc/TabParent.h +++ b/dom/ipc/TabParent.h @@ -215,7 +215,7 @@ class TabParent : public PBrowserParent const bool& stickDocument) MOZ_OVERRIDE; virtual bool DeallocPOfflineCacheUpdateParent(POfflineCacheUpdateParent* actor); - JSBool GetGlobalJSObject(JSContext* cx, JSObject** globalp); + bool GetGlobalJSObject(JSContext* cx, JSObject** globalp); NS_DECL_ISUPPORTS NS_DECL_NSIAUTHPROMPTPROVIDER diff --git a/dom/plugins/base/nsJSNPRuntime.cpp b/dom/plugins/base/nsJSNPRuntime.cpp index d3d1019ff8342..18aab3422d9d2 100644 --- a/dom/plugins/base/nsJSNPRuntime.cpp +++ b/dom/plugins/base/nsJSNPRuntime.cpp @@ -108,28 +108,28 @@ NPClass nsJSObjWrapper::sJSObjWrapperNPClass = nsJSObjWrapper::NP_Construct }; -static JSBool +static bool NPObjWrapper_AddProperty(JSContext *cx, JS::Handle obj, JS::Handle id, JS::MutableHandle vp); -static JSBool -NPObjWrapper_DelProperty(JSContext *cx, JS::Handle obj, JS::Handle id, JSBool *succeeded); +static bool +NPObjWrapper_DelProperty(JSContext *cx, JS::Handle obj, JS::Handle id, bool *succeeded); -static JSBool -NPObjWrapper_SetProperty(JSContext *cx, JS::Handle obj, JS::Handle id, JSBool strict, +static bool +NPObjWrapper_SetProperty(JSContext *cx, JS::Handle obj, JS::Handle id, bool strict, JS::MutableHandle vp); -static JSBool +static bool NPObjWrapper_GetProperty(JSContext *cx, JS::Handle obj, JS::Handle id, JS::MutableHandle vp); -static JSBool +static bool NPObjWrapper_newEnumerate(JSContext *cx, JS::Handle obj, JSIterateOp enum_op, JS::Value *statep, jsid *idp); -static JSBool +static bool NPObjWrapper_NewResolve(JSContext *cx, JS::Handle obj, JS::Handle id, unsigned flags, JS::MutableHandle objp); -static JSBool +static bool NPObjWrapper_Convert(JSContext *cx, JS::Handle obj, JSType type, JS::MutableHandle vp); static void @@ -141,7 +141,7 @@ NPObjWrapper_Call(JSContext *cx, unsigned argc, JS::Value *vp); static bool NPObjWrapper_Construct(JSContext *cx, unsigned argc, JS::Value *vp); -static JSBool +static bool CreateNPObjectMember(NPP npp, JSContext *cx, JSObject *obj, NPObject *npobj, JS::Handle id, NPVariant* getPropertyResult, JS::Value *vp); @@ -170,7 +170,7 @@ typedef struct NPObjectMemberPrivate { NPP npp; } NPObjectMemberPrivate; -static JSBool +static bool NPObjectMember_Convert(JSContext *cx, JS::Handle obj, JSType type, JS::MutableHandle vp); static void @@ -467,7 +467,7 @@ ThrowJSException(JSContext *cx, const char *message) } } -static JSBool +static bool ReportExceptionIfPending(JSContext *cx) { const char *ex = PeekException(); @@ -539,7 +539,7 @@ nsJSObjWrapper::NP_Invalidate(NPObject *npobj) } } -static JSBool +static bool GetProperty(JSContext *cx, JSObject *obj, NPIdentifier id, JS::MutableHandle rval) { NS_ASSERTION(NPIdentifierIsInt(id) || NPIdentifierIsString(id), @@ -574,7 +574,7 @@ nsJSObjWrapper::NP_HasMethod(NPObject *npobj, NPIdentifier id) AutoJSExceptionReporter reporter(cx); JS::Rooted v(cx); - JSBool ok = GetProperty(cx, npjsobj->mJSObj, id, &v); + bool ok = GetProperty(cx, npjsobj->mJSObj, id, &v); return ok && !JSVAL_IS_PRIMITIVE(v) && ::JS_ObjectIsFunction(cx, JSVAL_TO_OBJECT(v)); @@ -710,7 +710,7 @@ nsJSObjWrapper::NP_HasProperty(NPObject *npobj, NPIdentifier id) } nsJSObjWrapper *npjsobj = (nsJSObjWrapper *)npobj; - JSBool found, ok = false; + bool found, ok = false; nsCxPusher pusher; pusher.Push(cx); @@ -809,7 +809,7 @@ nsJSObjWrapper::NP_RemoveProperty(NPObject *npobj, NPIdentifier id) } nsJSObjWrapper *npjsobj = (nsJSObjWrapper *)npobj; - JSBool ok = false; + bool ok = false; nsCxPusher pusher; pusher.Push(cx); @@ -824,7 +824,7 @@ nsJSObjWrapper::NP_RemoveProperty(NPObject *npobj, NPIdentifier id) // FIXME: See bug 425823, we shouldn't need to do this, and once // that bug is fixed we can remove this code. - JSBool hasProp; + bool hasProp; ok = ::JS_HasPropertyById(cx, npjsobj->mJSObj, NPIdentifierToJSId(id), &hasProp); if (ok && hasProp) { @@ -1100,7 +1100,7 @@ GetNPObject(JSContext *cx, JSObject *obj) // Does not actually add a property because this is always followed by a // SetProperty call. -static JSBool +static bool NPObjWrapper_AddProperty(JSContext *cx, JS::Handle obj, JS::Handle id, JS::MutableHandle vp) { NPObject *npobj = GetNPObject(cx, obj); @@ -1119,7 +1119,7 @@ NPObjWrapper_AddProperty(JSContext *cx, JS::Handle obj, JS::Handle_class->hasProperty(npobj, identifier); + bool hasProperty = npobj->_class->hasProperty(npobj, identifier); if (!ReportExceptionIfPending(cx)) return false; @@ -1128,7 +1128,7 @@ NPObjWrapper_AddProperty(JSContext *cx, JS::Handle obj, JS::Handle_class->hasMethod(npobj, identifier); + bool hasMethod = npobj->_class->hasMethod(npobj, identifier); if (!ReportExceptionIfPending(cx)) return false; @@ -1141,8 +1141,8 @@ NPObjWrapper_AddProperty(JSContext *cx, JS::Handle obj, JS::Handle obj, JS::Handle id, JSBool *succeeded) +static bool +NPObjWrapper_DelProperty(JSContext *cx, JS::Handle obj, JS::Handle id, bool *succeeded) { NPObject *npobj = GetNPObject(cx, obj); @@ -1158,7 +1158,7 @@ NPObjWrapper_DelProperty(JSContext *cx, JS::Handle obj, JS::Handle_class->hasProperty(npobj, identifier); + bool hasProperty = npobj->_class->hasProperty(npobj, identifier); if (!ReportExceptionIfPending(cx)) return false; @@ -1174,8 +1174,8 @@ NPObjWrapper_DelProperty(JSContext *cx, JS::Handle obj, JS::Handle obj, JS::Handle id, JSBool strict, +static bool +NPObjWrapper_SetProperty(JSContext *cx, JS::Handle obj, JS::Handle id, bool strict, JS::MutableHandle vp) { NPObject *npobj = GetNPObject(cx, obj); @@ -1202,7 +1202,7 @@ NPObjWrapper_SetProperty(JSContext *cx, JS::Handle obj, JS::Handle_class->hasProperty(npobj, identifier); + bool hasProperty = npobj->_class->hasProperty(npobj, identifier); if (!ReportExceptionIfPending(cx)) return false; @@ -1220,7 +1220,7 @@ NPObjWrapper_SetProperty(JSContext *cx, JS::Handle obj, JS::Handle_class->setProperty(npobj, identifier, &npv); + bool ok = npobj->_class->setProperty(npobj, identifier, &npv); _releasevariantvalue(&npv); // Release the variant if (!ReportExceptionIfPending(cx)) return false; @@ -1234,7 +1234,7 @@ NPObjWrapper_SetProperty(JSContext *cx, JS::Handle obj, JS::Handle obj, JS::Handle id, JS::MutableHandle vp) { NPObject *npobj = GetNPObject(cx, obj); @@ -1272,8 +1272,8 @@ NPObjWrapper_GetProperty(JSContext *cx, JS::Handle obj, JS::HandleGetPropertyHelper(identifier, &hasProperty, - &hasMethod, &npv); + bool success = actor->GetPropertyHelper(identifier, &hasProperty, + &hasMethod, &npv); if (!ReportExceptionIfPending(cx)) { if (success) _releasevariantvalue(&npv); @@ -1321,7 +1321,7 @@ NPObjWrapper_GetProperty(JSContext *cx, JS::Handle obj, JS::Handle obj, unsigned argc, JS::Value *argv, JS::Value *rval, bool ctorCall) { @@ -1378,7 +1378,7 @@ CallNPMethodInternal(JSContext *cx, JS::Handle obj, unsigned argc, VOID_TO_NPVARIANT(v); JSObject *funobj = JSVAL_TO_OBJECT(argv[-2]); - JSBool ok; + bool ok; const char *msg = "Error calling method on NPObject!"; if (ctorCall) { @@ -1464,7 +1464,7 @@ struct NPObjectEnumerateState { NPIdentifier *value; }; -static JSBool +static bool NPObjWrapper_newEnumerate(JSContext *cx, JS::Handle obj, JSIterateOp enum_op, JS::Value *statep, jsid *idp) { @@ -1544,7 +1544,7 @@ NPObjWrapper_newEnumerate(JSContext *cx, JS::Handle obj, JSIterateOp return true; } -static JSBool +static bool NPObjWrapper_NewResolve(JSContext *cx, JS::Handle obj, JS::Handle id, unsigned flags, JS::MutableHandle objp) { @@ -1598,7 +1598,7 @@ NPObjWrapper_NewResolve(JSContext *cx, JS::Handle obj, JS::Handle obj, JSType hint, JS::MutableHandle vp) { JS_ASSERT(hint == JSTYPE_NUMBER || hint == JSTYPE_STRING || hint == JSTYPE_VOID); @@ -1940,7 +1940,7 @@ LookupNPP(NPObject *npobj) return entry->mNpp; } -JSBool +bool CreateNPObjectMember(NPP npp, JSContext *cx, JSObject *obj, NPObject* npobj, JS::Handle id, NPVariant* getPropertyResult, JS::Value *vp) { @@ -2016,7 +2016,7 @@ CreateNPObjectMember(NPP npp, JSContext *cx, JSObject *obj, NPObject* npobj, return true; } -static JSBool +static bool NPObjectMember_Convert(JSContext *cx, JS::Handle obj, JSType type, JS::MutableHandle vp) { NPObjectMemberPrivate *memberPrivate = @@ -2114,7 +2114,7 @@ NPObjectMember_Call(JSContext *cx, unsigned argc, JS::Value *vp) NPVariant npv; - JSBool ok; + bool ok; ok = npobj->_class->invoke(npobj, JSIdToNPIdentifier(memberPrivate->methodName), npargs, argc, &npv); diff --git a/dom/plugins/ipc/PluginScriptableObjectParent.cpp b/dom/plugins/ipc/PluginScriptableObjectParent.cpp index 1bb9452f143af..3d0d23b60de86 100644 --- a/dom/plugins/ipc/PluginScriptableObjectParent.cpp +++ b/dom/plugins/ipc/PluginScriptableObjectParent.cpp @@ -1212,7 +1212,7 @@ PluginScriptableObjectParent::AnswerNPN_Evaluate(const nsCString& aScript, return true; } -JSBool +bool PluginScriptableObjectParent::GetPropertyHelper(NPIdentifier aName, bool* aHasProperty, bool* aHasMethod, diff --git a/dom/plugins/ipc/PluginScriptableObjectParent.h b/dom/plugins/ipc/PluginScriptableObjectParent.h index 2d3613e90fcdd..16d6881f6f204 100644 --- a/dom/plugins/ipc/PluginScriptableObjectParent.h +++ b/dom/plugins/ipc/PluginScriptableObjectParent.h @@ -137,10 +137,10 @@ class PluginScriptableObjectParent : public PPluginScriptableObjectParent return mType; } - JSBool GetPropertyHelper(NPIdentifier aName, - bool* aHasProperty, - bool* aHasMethod, - NPVariant* aResult); + bool GetPropertyHelper(NPIdentifier aName, + bool* aHasProperty, + bool* aHasMethod, + NPVariant* aResult); private: static NPObject* diff --git a/dom/src/geolocation/nsGeolocation.cpp b/dom/src/geolocation/nsGeolocation.cpp index c579650ee34bc..dfe0712e27d3d 100644 --- a/dom/src/geolocation/nsGeolocation.cpp +++ b/dom/src/geolocation/nsGeolocation.cpp @@ -723,7 +723,7 @@ nsGeolocationService::HandleMozsettingChanged(const PRUnichar* aData) return; } - JSBool match; + bool match; if (!JS_StringEqualsAscii(cx, key.toString(), GEO_SETINGS_ENABLED, &match) || !match) { return; } diff --git a/dom/src/json/nsJSON.cpp b/dom/src/json/nsJSON.cpp index bc8c19ecce22f..5a2f85aaeaf7b 100644 --- a/dom/src/json/nsJSON.cpp +++ b/dom/src/json/nsJSON.cpp @@ -159,7 +159,7 @@ nsJSON::EncodeToStream(nsIOutputStream *aStream, return rv; } -static JSBool +static bool WriteCallback(const jschar *buf, uint32_t len, void *data) { nsJSONWriter *writer = static_cast(data); @@ -527,7 +527,7 @@ nsJSONListener::OnStopRequest(nsIRequest *aRequest, nsISupports *aContext, JS::StableCharPtr chars(reinterpret_cast(mBufferedChars.Elements()), mBufferedChars.Length()); - JSBool ok = JS_ParseJSONWithReviver(mCx, chars.get(), + bool ok = JS_ParseJSONWithReviver(mCx, chars.get(), uint32_t(mBufferedChars.Length()), reviver, value.address()); diff --git a/dom/system/gonk/TimeZoneSettingObserver.cpp b/dom/system/gonk/TimeZoneSettingObserver.cpp index 3d192e1d87ea4..a61e8a4a29975 100644 --- a/dom/system/gonk/TimeZoneSettingObserver.cpp +++ b/dom/system/gonk/TimeZoneSettingObserver.cpp @@ -185,7 +185,7 @@ TimeZoneSettingObserver::Observe(nsISupports *aSubject, !key.isString()) { return NS_OK; } - JSBool match; + bool match; if (!JS_StringEqualsAscii(cx, key.toString(), TIME_TIMEZONE, &match) || !match) { return NS_OK; diff --git a/dom/workers/EventListenerManager.cpp b/dom/workers/EventListenerManager.cpp index 4403fdd055b8c..923629c68b58f 100644 --- a/dom/workers/EventListenerManager.cpp +++ b/dom/workers/EventListenerManager.cpp @@ -314,7 +314,7 @@ EventListenerManager::DispatchEvent(JSContext* aCx, const EventTarget& aTarget, } JS::Rooted eventType(aCx); - JSBool eventIsTrusted; + bool eventIsTrusted; if (!JS_GetProperty(aCx, aEvent, "type", &val) || !(eventType = JS_ValueToString(aCx, val)) || @@ -398,7 +398,7 @@ EventListenerManager::DispatchEvent(JSContext* aCx, const EventTarget& aTarget, JS::Rooted thisObj(aCx, aTarget.GetJSObject()); - JSBool hasHandleEvent; + bool hasHandleEvent; if (!JS_HasProperty(aCx, listenerObj, sHandleEventChars, &hasHandleEvent)) { if (!JS_ReportPendingException(aCx)) { aRv.Throw(NS_ERROR_FAILURE); diff --git a/dom/workers/Events.cpp b/dom/workers/Events.cpp index 373fcd1d14a13..4ebc26d298748 100644 --- a/dom/workers/Events.cpp +++ b/dom/workers/Events.cpp @@ -184,7 +184,7 @@ class Event : public PrivatizableBase static void InitEventCommon(JSObject* aObj, Event* aEvent, JSString* aType, - JSBool aBubbles, JSBool aCancelable, bool aIsTrusted) + bool aBubbles, bool aCancelable, bool aIsTrusted) { aEvent->mStopPropagationCalled = false; aEvent->mStopImmediatePropagationCalled = false; @@ -219,7 +219,7 @@ class Event : public PrivatizableBase delete GetJSPrivateSafeish(aObj); } - static JSBool + static bool GetProperty(JSContext* aCx, JS::Handle aObj, JS::Handle aIdval, JS::MutableHandle aVp) { @@ -236,7 +236,7 @@ class Event : public PrivatizableBase return true; } - static JSBool + static bool GetConstant(JSContext* aCx, JS::Handle aObj, JS::Handle idval, JS::MutableHandle aVp) { @@ -318,7 +318,7 @@ class Event : public PrivatizableBase } JS::Rooted type(aCx); - JSBool bubbles, cancelable; + bool bubbles, cancelable; if (!JS_ConvertArguments(aCx, aArgc, JS_ARGV(aCx, aVp), "Sbb", type.address(), &bubbles, &cancelable)) { return false; @@ -475,7 +475,7 @@ class MessageEvent : public Event static void InitMessageEventCommon(JSContext* aCx, JSObject* aObj, Event* aEvent, - JSString* aType, JSBool aBubbles, JSBool aCancelable, + JSString* aType, bool aBubbles, bool aCancelable, JSString* aData, JSString* aOrigin, JSObject* aSource, bool aIsTrusted) { @@ -506,7 +506,7 @@ class MessageEvent : public Event delete priv; } - static JSBool + static bool GetProperty(JSContext* aCx, JS::Handle aObj, JS::Handle aIdval, JS::MutableHandle aVp) { @@ -561,7 +561,7 @@ class MessageEvent : public Event } JS::Rooted type(aCx), data(aCx), origin(aCx); - JSBool bubbles, cancelable; + bool bubbles, cancelable; JS::Rooted source(aCx); if (!JS_ConvertArguments(aCx, aArgc, JS_ARGV(aCx, aVp), "SbbSSo", type.address(), &bubbles, &cancelable, data.address(), @@ -688,7 +688,7 @@ class ErrorEvent : public Event static void InitErrorEventCommon(JSObject* aObj, Event* aEvent, JSString* aType, - JSBool aBubbles, JSBool aCancelable, + bool aBubbles, bool aCancelable, JSString* aMessage, JSString* aFilename, uint32_t aLineNumber, bool aIsTrusted) { @@ -714,7 +714,7 @@ class ErrorEvent : public Event delete GetJSPrivateSafeish(aObj); } - static JSBool + static bool GetProperty(JSContext* aCx, JS::Handle aObj, JS::Handle aIdval, JS::MutableHandle aVp) { @@ -748,7 +748,7 @@ class ErrorEvent : public Event } JS::Rooted type(aCx), message(aCx), filename(aCx); - JSBool bubbles, cancelable; + bool bubbles, cancelable; uint32_t lineNumber; if (!JS_ConvertArguments(aCx, aArgc, JS_ARGV(aCx, aVp), "SbbSSu", type.address(), &bubbles, &cancelable, message.address(), @@ -867,8 +867,8 @@ class ProgressEvent : public Event static void InitProgressEventCommon(JSObject* aObj, Event* aEvent, JSString* aType, - JSBool aBubbles, JSBool aCancelable, - JSBool aLengthComputable, double aLoaded, + bool aBubbles, bool aCancelable, + bool aLengthComputable, double aLoaded, double aTotal, bool aIsTrusted) { Event::InitEventCommon(aObj, aEvent, aType, aBubbles, aCancelable, @@ -894,7 +894,7 @@ class ProgressEvent : public Event delete GetJSPrivateSafeish(aObj); } - static JSBool + static bool GetProperty(JSContext* aCx, JS::Handle aObj, JS::Handle aIdval, JS::MutableHandle aVp) { @@ -1031,12 +1031,12 @@ DispatchEventToTarget(JSContext* aCx, JS::Handle aTarget, JS::Handle aEvent, bool* aPreventDefaultCalled) { static const char kFunctionName[] = "dispatchEvent"; - JSBool hasProperty; + bool hasProperty; if (!JS_HasProperty(aCx, aTarget, kFunctionName, &hasProperty)) { return false; } - JSBool preventDefaultCalled = false; + bool preventDefaultCalled = false; if (hasProperty) { jsval argv[] = { OBJECT_TO_JSVAL(aEvent) }; JS::Rooted rval(aCx, JS::UndefinedValue()); diff --git a/dom/workers/Exceptions.cpp b/dom/workers/Exceptions.cpp index 49123afd63216..77b5a05eafc3d 100644 --- a/dom/workers/Exceptions.cpp +++ b/dom/workers/Exceptions.cpp @@ -125,7 +125,7 @@ class DOMException : public PrivatizableBase return true; } - static JSBool + static bool GetProperty(JSContext* aCx, JS::Handle aObj, JS::Handle aIdval, JS::MutableHandle aVp) { @@ -146,7 +146,7 @@ class DOMException : public PrivatizableBase return true; } - static JSBool + static bool GetConstant(JSContext* aCx, JS::Handle aObj, JS::Handle idval, JS::MutableHandle aVp) { diff --git a/dom/workers/File.cpp b/dom/workers/File.cpp index 8267f64f6ed1b..f7121dd936054 100644 --- a/dom/workers/File.cpp +++ b/dom/workers/File.cpp @@ -112,7 +112,7 @@ class Blob NS_IF_RELEASE(blob); } - static JSBool + static bool GetSize(JSContext* aCx, JS::Handle aObj, JS::Handle aIdval, JS::MutableHandle aVp) { @@ -132,7 +132,7 @@ class Blob return true; } - static JSBool + static bool GetType(JSContext* aCx, JS::Handle aObj, JS::Handle aIdval, JS::MutableHandle aVp) { @@ -303,7 +303,7 @@ class File : public Blob NS_IF_RELEASE(file); } - static JSBool + static bool GetMozFullPath(JSContext* aCx, JS::Handle aObj, JS::Handle aIdval, JS::MutableHandle aVp) { @@ -330,7 +330,7 @@ class File : public Blob return true; } - static JSBool + static bool GetName(JSContext* aCx, JS::Handle aObj, JS::Handle aIdval, JS::MutableHandle aVp) { @@ -353,7 +353,7 @@ class File : public Blob return true; } - static JSBool + static bool GetLastModifiedDate(JSContext* aCx, JS::Handle aObj, JS::Handle aIdval, JS::MutableHandle aVp) { diff --git a/dom/workers/RuntimeService.cpp b/dom/workers/RuntimeService.cpp index 8a63f67a38651..e4ef37337e0cf 100644 --- a/dom/workers/RuntimeService.cpp +++ b/dom/workers/RuntimeService.cpp @@ -587,7 +587,7 @@ ErrorReporter(JSContext* aCx, const char* aMessage, JSErrorReport* aReport) return worker->ReportError(aCx, aMessage, aReport); } -JSBool +bool OperationCallback(JSContext* aCx) { WorkerPrivate* worker = GetWorkerPrivateFromContext(aCx); @@ -690,7 +690,7 @@ class LogViolationDetailsRunnable : public nsRunnable } }; -JSBool +bool ContentSecurityPolicyAllows(JSContext* aCx) { WorkerPrivate* worker = GetWorkerPrivateFromContext(aCx); @@ -940,7 +940,7 @@ class WorkerThreadRunnable : public nsRunnable BEGIN_WORKERS_NAMESPACE // Entry point for the DOM. -JSBool +bool ResolveWorkerClasses(JSContext* aCx, JS::Handle aObj, JS::Handle aId, unsigned aFlags, JS::MutableHandle aObjp) { diff --git a/dom/workers/Worker.cpp b/dom/workers/Worker.cpp index 9ac2d53e9965d..cb59f7a2b03e9 100644 --- a/dom/workers/Worker.cpp +++ b/dom/workers/Worker.cpp @@ -175,7 +175,7 @@ class Worker Worker(); ~Worker(); - static JSBool + static bool GetEventListener(JSContext* aCx, JS::Handle aObj, JS::Handle aIdval, JS::MutableHandle aVp) { @@ -200,9 +200,9 @@ class Worker return true; } - static JSBool + static bool SetEventListener(JSContext* aCx, JS::Handle aObj, JS::Handle aIdval, - JSBool aStrict, JS::MutableHandle aVp) + bool aStrict, JS::MutableHandle aVp) { JS_ASSERT(JSID_IS_INT(aIdval)); JS_ASSERT(JSID_TO_INT(aIdval) >= 0 && JSID_TO_INT(aIdval) < STRING_COUNT); diff --git a/dom/workers/WorkerPrivate.cpp b/dom/workers/WorkerPrivate.cpp index 81d838538f807..a73ba6cf87a69 100644 --- a/dom/workers/WorkerPrivate.cpp +++ b/dom/workers/WorkerPrivate.cpp @@ -220,7 +220,7 @@ struct WorkerStructuredCloneCallbacks return nullptr; } - static JSBool + static bool Write(JSContext* aCx, JSStructuredCloneWriter* aWriter, JS::Handle aObj, void* aClosure) { @@ -371,7 +371,7 @@ struct MainThreadWorkerStructuredCloneCallbacks return NS_DOMReadStructuredClone(aCx, aReader, aTag, aData, nullptr); } - static JSBool + static bool Write(JSContext* aCx, JSStructuredCloneWriter* aWriter, JS::Handle aObj, void* aClosure) { @@ -459,7 +459,7 @@ struct ChromeWorkerStructuredCloneCallbacks aClosure); } - static JSBool + static bool Write(JSContext* aCx, JSStructuredCloneWriter* aWriter, JS::Handle aObj, void* aClosure) { @@ -505,7 +505,7 @@ struct MainThreadChromeWorkerStructuredCloneCallbacks return NS_DOMReadStructuredClone(aCx, aReader, aTag, aData, nullptr); } - static JSBool + static bool Write(JSContext* aCx, JSStructuredCloneWriter* aWriter, JS::Handle aObj, void* aClosure) { diff --git a/dom/workers/WorkerScope.cpp b/dom/workers/WorkerScope.cpp index f4949784d0310..9ca263cdf0117 100644 --- a/dom/workers/WorkerScope.cpp +++ b/dom/workers/WorkerScope.cpp @@ -144,7 +144,7 @@ class WorkerGlobalScope : public workers::EventTarget } private: - static JSBool + static bool GetEventListener(JSContext* aCx, JS::Handle aObj, JS::Handle aIdval, JS::MutableHandle aVp) { @@ -171,9 +171,9 @@ class WorkerGlobalScope : public workers::EventTarget return true; } - static JSBool + static bool SetEventListener(JSContext* aCx, JS::Handle aObj, JS::Handle aIdval, - JSBool aStrict, JS::MutableHandle aVp) + bool aStrict, JS::MutableHandle aVp) { JS_ASSERT(JSID_IS_INT(aIdval)); JS_ASSERT(JSID_TO_INT(aIdval) >= 0 && JSID_TO_INT(aIdval) < STRING_COUNT); @@ -212,7 +212,7 @@ class WorkerGlobalScope : public workers::EventTarget return false; } - static JSBool + static bool GetSelf(JSContext* aCx, JS::Handle aObj, JS::Handle aIdval, JS::MutableHandle aVp) { @@ -224,7 +224,7 @@ class WorkerGlobalScope : public workers::EventTarget return true; } - static JSBool + static bool GetLocation(JSContext* aCx, JS::Handle aObj, JS::Handle aIdval, JS::MutableHandle aVp) { @@ -289,7 +289,7 @@ class WorkerGlobalScope : public workers::EventTarget return true; } - static JSBool + static bool GetOnErrorListener(JSContext* aCx, JS::Handle aObj, JS::Handle aIdval, JS::MutableHandle aVp) { @@ -321,9 +321,9 @@ class WorkerGlobalScope : public workers::EventTarget return true; } - static JSBool + static bool SetOnErrorListener(JSContext* aCx, JS::Handle aObj, JS::Handle aIdval, - JSBool aStrict, JS::MutableHandle aVp) + bool aStrict, JS::MutableHandle aVp) { const char* name = sEventStrings[STRING_onerror]; WorkerGlobalScope* scope = GetInstancePrivate(aCx, aObj, name); @@ -364,7 +364,7 @@ class WorkerGlobalScope : public workers::EventTarget return true; } - static JSBool + static bool GetNavigator(JSContext* aCx, JS::Handle aObj, JS::Handle aIdval, JS::MutableHandle aVp) { @@ -486,7 +486,7 @@ class WorkerGlobalScope : public workers::EventTarget return scope->mWorker->SetTimeout(aCx, aArgc, aVp, true); } - static JSBool + static bool ClearInterval(JSContext* aCx, unsigned aArgc, jsval* aVp) { JSObject* obj = JS_THIS_OBJECT(aCx, aVp); @@ -679,7 +679,7 @@ class DedicatedWorkerGlobalScope : public WorkerGlobalScope return proto; } - static JSBool + static bool InitPrivate(JSContext* aCx, JSObject* aObj, WorkerPrivate* aWorkerPrivate) { JS_ASSERT(JS_GetClass(aObj) == Class()); @@ -714,7 +714,7 @@ class DedicatedWorkerGlobalScope : public WorkerGlobalScope using EventTarget::GetEventListener; using EventTarget::SetEventListener; - static JSBool + static bool GetEventListener(JSContext* aCx, JS::Handle aObj, JS::Handle aIdval, JS::MutableHandle aVp) { @@ -741,9 +741,9 @@ class DedicatedWorkerGlobalScope : public WorkerGlobalScope return true; } - static JSBool + static bool SetEventListener(JSContext* aCx, JS::Handle aObj, JS::Handle aIdval, - JSBool aStrict, JS::MutableHandle aVp) + bool aStrict, JS::MutableHandle aVp) { JS_ASSERT(JSID_IS_INT(aIdval)); JS_ASSERT(JSID_TO_INT(aIdval) >= 0 && JSID_TO_INT(aIdval) < STRING_COUNT); @@ -795,11 +795,11 @@ class DedicatedWorkerGlobalScope : public WorkerGlobalScope return false; } - static JSBool + static bool Resolve(JSContext* aCx, JS::Handle aObj, JS::Handle aId, unsigned aFlags, JS::MutableHandle aObjp) { - JSBool resolved; + bool resolved; if (!JS_ResolveStandardClass(aCx, aObj, aId, &resolved)) { return false; } diff --git a/dom/workers/Workers.h b/dom/workers/Workers.h index fbce08a7a031f..2ebe88135e92a 100644 --- a/dom/workers/Workers.h +++ b/dom/workers/Workers.h @@ -164,7 +164,7 @@ struct JSSettings }; // All of these are implemented in RuntimeService.cpp -JSBool +bool ResolveWorkerClasses(JSContext* aCx, JS::Handle aObj, JS::Handle aId, unsigned aFlags, JS::MutableHandle aObjp); diff --git a/gfx/skia/patches/archive/0010-Bug-689069-ARM-Opts.patch b/gfx/skia/patches/archive/0010-Bug-689069-ARM-Opts.patch index c2e647ec9efe8..bd6604b4bdb53 100644 --- a/gfx/skia/patches/archive/0010-Bug-689069-ARM-Opts.patch +++ b/gfx/skia/patches/archive/0010-Bug-689069-ARM-Opts.patch @@ -16,7 +16,7 @@ index f2e7a83..b2717d7 100644 @@ -74,7 +74,7 @@ extern "C" { #endif - static JSBool + static bool -global_enumerate(JSContext *cx, JSObject *obj) +global_enumerate(JSContext *cx, JSHandleObject *obj) { @@ -25,7 +25,7 @@ index f2e7a83..b2717d7 100644 @@ -84,7 +84,7 @@ global_enumerate(JSContext *cx, JSObject *obj) } - static JSBool + static bool -global_resolve(JSContext *cx, JSObject *obj, jsval id, uintN flags, JSObject **objp) +global_resolve(JSContext *cx, JSHandleObject obj, JSHandleId id, unsigned flags, JSObject **objp) { diff --git a/gfx/skia/src/xml/SkJS.cpp b/gfx/skia/src/xml/SkJS.cpp index 777f59890f37a..724269514d639 100644 --- a/gfx/skia/src/xml/SkJS.cpp +++ b/gfx/skia/src/xml/SkJS.cpp @@ -73,7 +73,7 @@ extern "C" { } #endif -static JSBool +static bool global_enumerate(JSContext *cx, JSObject *obj) { #ifdef LAZY_STANDARD_CLASSES @@ -83,12 +83,12 @@ global_enumerate(JSContext *cx, JSObject *obj) #endif } -static JSBool +static bool global_resolve(JSContext *cx, JSObject *obj, jsval id, uintN flags, JSObject **objp) { #ifdef LAZY_STANDARD_CLASSES if ((flags & JSRESOLVE_ASSIGNING) == 0) { - JSBool resolved; + bool resolved; if (!JS_ResolveStandardClass(cx, obj, id, &resolved)) return false; @@ -107,7 +107,7 @@ global_resolve(JSContext *cx, JSObject *obj, jsval id, uintN flags, JSObject **o */ char *path, *comp, *full; const char *name; - JSBool ok, found; + bool ok, found; JSFunction *fun; if (!JSVAL_IS_STRING(id)) diff --git a/gfx/skia/src/xml/SkJSDisplayable.cpp b/gfx/skia/src/xml/SkJSDisplayable.cpp index 3f59922276b8b..9eda74bdd6957 100644 --- a/gfx/skia/src/xml/SkJSDisplayable.cpp +++ b/gfx/skia/src/xml/SkJSDisplayable.cpp @@ -60,19 +60,19 @@ class SkJSDisplayable { SkJSDisplayable() : fDisplayable(NULL) {} ~SkJSDisplayable() { delete fDisplayable; } static void Destructor(JSContext *cx, JSObject *obj); - static JSBool GetProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp); - static JSBool SetProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp); + static bool GetProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp); + static bool SetProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp); static SkCanvas* gCanvas; static SkPaint* gPaint; - static JSBool Draw(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval); + static bool Draw(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval); SkDisplayable* fDisplayable; }; SkCanvas* SkJSDisplayable::gCanvas; SkPaint* SkJSDisplayable::gPaint; -JSBool SkJSDisplayable::Draw(JSContext *cx, JSObject *obj, uintN argc, - jsval *argv, jsval *rval) +bool SkJSDisplayable::Draw(JSContext *cx, JSObject *obj, uintN argc, + jsval *argv, jsval *rval) { SkJSDisplayable *p = (SkJSDisplayable*) JS_GetPrivate(cx, obj); SkASSERT(p->fDisplayable->isDrawable()); @@ -93,7 +93,7 @@ static JSPropertySpec* gDisplayableProperties[kNumberOfTypes]; static JSClass gDisplayableClasses[kNumberOfTypes]; #define JS_INIT(_prefix, _class) \ -static JSBool _class##Constructor(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) { \ +static bool _class##Constructor(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) { \ SkJSDisplayable* jsDisplayable = new SkJSDisplayable(); \ jsDisplayable->fDisplayable = new _prefix##_class(); \ JS_SetPrivate(cx, obj, (void*) jsDisplayable); \ @@ -215,8 +215,8 @@ void SkJSDisplayable::Destructor(JSContext *cx, JSObject *obj) { delete (SkJSDisplayable*) JS_GetPrivate(cx, obj); } -JSBool SkJSDisplayable::GetProperty(JSContext *cx, JSObject *obj, jsval id, - jsval *vp) +bool SkJSDisplayable::GetProperty(JSContext *cx, JSObject *obj, jsval id, + jsval *vp) { if (JSVAL_IS_INT(id) == 0) return true; @@ -293,7 +293,7 @@ JSBool SkJSDisplayable::GetProperty(JSContext *cx, JSObject *obj, jsval id, return true; } -JSBool SkJSDisplayable::SetProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp) { +bool SkJSDisplayable::SetProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp) { if (JSVAL_IS_INT(id) == 0) return true; SkJSDisplayable *p = (SkJSDisplayable *) JS_GetPrivate(cx, obj); diff --git a/ipc/testshell/TestShellParent.cpp b/ipc/testshell/TestShellParent.cpp index a89e6aa5accf2..48a31c650c805 100644 --- a/ipc/testshell/TestShellParent.cpp +++ b/ipc/testshell/TestShellParent.cpp @@ -35,13 +35,13 @@ TestShellParent::CommandDone(TestShellCommandParent* command, const nsString& aResponse) { // XXX what should happen if the callback fails? - /*JSBool ok = */command->RunCallback(aResponse); + /*bool ok = */command->RunCallback(aResponse); command->ReleaseCallback(); return true; } -JSBool +bool TestShellCommandParent::SetCallback(JSContext* aCx, JS::Value aCallback) { @@ -55,7 +55,7 @@ TestShellCommandParent::SetCallback(JSContext* aCx, return true; } -JSBool +bool TestShellCommandParent::RunCallback(const nsString& aResponse) { NS_ENSURE_TRUE(*mCallback.ToJSValPtr() != JSVAL_NULL && mCx, false); @@ -71,7 +71,7 @@ TestShellCommandParent::RunCallback(const nsString& aResponse) JS::Rooted strVal(mCx, JS::StringValue(str)); JS::Rooted rval(mCx); - JSBool ok = JS_CallFunctionValue(mCx, global, mCallback, 1, strVal.address(), + bool ok = JS_CallFunctionValue(mCx, global, mCallback, 1, strVal.address(), rval.address()); NS_ENSURE_TRUE(ok, false); diff --git a/ipc/testshell/TestShellParent.h b/ipc/testshell/TestShellParent.h index 070f4b186e51c..12be80a6b6747 100644 --- a/ipc/testshell/TestShellParent.h +++ b/ipc/testshell/TestShellParent.h @@ -43,10 +43,9 @@ class TestShellCommandParent : public PTestShellCommandParent public: TestShellCommandParent() : mCx(NULL) { } - JSBool SetCallback(JSContext* aCx, - JS::Value aCallback); + bool SetCallback(JSContext* aCx, JS::Value aCallback); - JSBool RunCallback(const nsString& aResponse); + bool RunCallback(const nsString& aResponse); void ReleaseCallback(); diff --git a/ipc/testshell/XPCShellEnvironment.cpp b/ipc/testshell/XPCShellEnvironment.cpp index 2f2cd9af81f62..481f88c30a0b4 100644 --- a/ipc/testshell/XPCShellEnvironment.cpp +++ b/ipc/testshell/XPCShellEnvironment.cpp @@ -112,7 +112,7 @@ Print(JSContext *cx, return true; } -static JSBool +static bool GetLine(char *bufp, FILE *file, const char *prompt) @@ -289,7 +289,7 @@ DumpHeap(JSContext *cx, size_t maxDepth = (size_t)-1; void *thingToIgnore = NULL; FILE *dumpFile; - JSBool ok; + bool ok; JS::Value *argv = JS_ARGV(cx, vp); JS_SET_RVAL(cx, vp, JSVAL_VOID); @@ -401,14 +401,14 @@ XPCShellEnvironment::ProcessFile(JSContext *cx, JS::Handle obj, const char *filename, FILE *file, - JSBool forceTTY) + bool forceTTY) { XPCShellEnvironment* env = this; JSScript *script; JS::Rooted result(cx); int lineno, startline; - JSBool ok, hitEOF; + bool ok, hitEOF; char *bufp, buffer[4096]; JSString *str; @@ -702,7 +702,7 @@ XPCShellEnvironment::EvaluateString(const nsString& aString, } JS::Rooted result(cx); - JSBool ok = JS_ExecuteScript(cx, global, script, result.address()); + bool ok = JS_ExecuteScript(cx, global, script, result.address()); if (ok && result != JSVAL_VOID) { JSErrorReporter old = JS_SetErrorReporter(cx, NULL); JSString* str = JS_ValueToString(cx, result); diff --git a/ipc/testshell/XPCShellEnvironment.h b/ipc/testshell/XPCShellEnvironment.h index 42475ec2395bb..8c4aaf73d14b3 100644 --- a/ipc/testshell/XPCShellEnvironment.h +++ b/ipc/testshell/XPCShellEnvironment.h @@ -31,7 +31,7 @@ class XPCShellEnvironment ~XPCShellEnvironment(); void ProcessFile(JSContext *cx, JS::Handle obj, - const char *filename, FILE *file, JSBool forceTTY); + const char *filename, FILE *file, bool forceTTY); bool EvaluateString(const nsString& aString, nsString* aResult = nullptr); @@ -46,7 +46,7 @@ class XPCShellEnvironment void SetIsQuitting() { mQuitting = true; } - JSBool IsQuitting() { + bool IsQuitting() { return mQuitting; } @@ -57,7 +57,7 @@ class XPCShellEnvironment private: nsAutoJSValHolder mGlobalHolder; - JSBool mQuitting; + bool mQuitting; }; } /* namespace ipc */ diff --git a/js/ipc/JavaScriptChild.cpp b/js/ipc/JavaScriptChild.cpp index dcc02aff883f7..972de7e3b7a75 100644 --- a/js/ipc/JavaScriptChild.cpp +++ b/js/ipc/JavaScriptChild.cpp @@ -313,7 +313,7 @@ JavaScriptChild::AnswerHas(const ObjectId &objId, const nsString &id, ReturnStat if (!convertGeckoStringToId(cx, id, &internedId)) return fail(cx, rs); - JSBool found; + bool found; if (!JS_HasPropertyById(cx, obj, internedId, &found)) return fail(cx, rs); *bp = !!found; @@ -435,7 +435,7 @@ JavaScriptChild::AnswerIsExtensible(const ObjectId &objId, ReturnStatus *rs, boo if (!obj) return false; - JSBool extensible; + bool extensible; if (!JS_IsExtensible(cx, obj, &extensible)) return fail(cx, rs); @@ -517,7 +517,7 @@ JavaScriptChild::AnswerCall(const ObjectId &objId, const nsTArray &argv RootedObject obj(cx, &outobjects[i].toObject()); RootedValue v(cx); - JSBool found; + bool found; if (JS_HasProperty(cx, obj, "value", &found)) { if (!JS_GetProperty(cx, obj, "value", &v)) return fail(cx, rs); @@ -642,7 +642,7 @@ JavaScriptChild::AnswerDOMInstanceOf(const ObjectId &objId, const int &prototype JSAutoCompartment comp(cx, obj); - JSBool tmp; + bool tmp; if (!mozilla::dom::InterfaceHasInstance(cx, prototypeID, depth, obj, &tmp)) return fail(cx, rs); *instanceof = tmp; diff --git a/js/ipc/JavaScriptParent.cpp b/js/ipc/JavaScriptParent.cpp index f59321340c850..c9e810bfe140d 100644 --- a/js/ipc/JavaScriptParent.cpp +++ b/js/ipc/JavaScriptParent.cpp @@ -394,7 +394,7 @@ JavaScriptParent::call(JSContext *cx, HandleObject proxy, const CallArgs &args) JSObject *obj = &v.toObject(); if (xpc::IsOutObject(cx, obj)) { // Make sure it is not an in-out object. - JSBool found; + bool found; if (!JS_HasProperty(cx, obj, "value", &found)) return false; if (found) { diff --git a/js/ipc/JavaScriptShared.cpp b/js/ipc/JavaScriptShared.cpp index 9e2b254eb144e..1036435f14b58 100644 --- a/js/ipc/JavaScriptShared.cpp +++ b/js/ipc/JavaScriptShared.cpp @@ -354,15 +354,15 @@ JavaScriptShared::fromDescriptor(JSContext *cx, const JSPropertyDescriptor &desc return true; } -JSBool +bool UnknownPropertyStub(JSContext *cx, HandleObject obj, HandleId id, MutableHandleValue vp) { JS_ReportError(cx, "getter could not be wrapped via CPOWs"); return false; } -JSBool -UnknownStrictPropertyStub(JSContext *cx, HandleObject obj, HandleId id, JSBool strict, MutableHandleValue vp) +bool +UnknownStrictPropertyStub(JSContext *cx, HandleObject obj, HandleId id, bool strict, MutableHandleValue vp) { JS_ReportError(cx, "setter could not be wrapped via CPOWs"); return false; diff --git a/js/jsd/jsd.h b/js/jsd/jsd.h index 92460342966c4..04b2d74602204 100644 --- a/js/jsd/jsd.h +++ b/js/jsd/jsd.h @@ -80,7 +80,7 @@ typedef struct JSDProfileData JSDProfileData; struct JSDContext { JSCList links; /* we are part of a JSCList */ - JSBool inited; + bool inited; void* data; uint32_t flags; JSD_ScriptHookProc scriptHook; @@ -163,12 +163,12 @@ struct JSDSourceText JSCList links; /* we are part of a JSCList */ char* url; char* text; - unsigned textLength; - unsigned textSpace; - JSBool dirty; + unsigned textLength; + unsigned textSpace; + bool dirty; JSDSourceStatus status; - unsigned alterCount; - JSBool doingEval; + unsigned alterCount; + bool doingEval; }; struct JSDExecHook @@ -289,7 +289,7 @@ extern void jsd_DebuggerOff(JSDContext* jsdc); extern void -jsd_DebuggerPause(JSDContext* jsdc, JSBool forceAllHooksOff); +jsd_DebuggerPause(JSDContext* jsdc, bool forceAllHooksOff); extern void jsd_DebuggerUnpause(JSDContext* jsdc); @@ -309,12 +309,12 @@ jsd_GetContextPrivate(JSDContext* jsdc); extern void jsd_ClearAllProfileData(JSDContext* jsdc); -extern JSBool +extern bool jsd_SetErrorReporter(JSDContext* jsdc, JSD_ErrorReporter reporter, void* callerdata); -extern JSBool +extern bool jsd_GetErrorReporter(JSDContext* jsdc, JSD_ErrorReporter* reporter, void** callerdata); @@ -322,7 +322,7 @@ jsd_GetErrorReporter(JSDContext* jsdc, /***************************************************************************/ /* Script functions */ -extern JSBool +extern bool jsd_InitScriptManager(JSDContext *jsdc); extern void @@ -389,7 +389,7 @@ jsd_SetScriptPrivate (JSDScript *jsdscript, void *data); extern void * jsd_GetScriptPrivate (JSDScript *jsdscript); -extern JSBool +extern bool jsd_IsActiveScript(JSDContext* jsdc, JSDScript *jsdscript); extern const char* @@ -404,10 +404,10 @@ jsd_GetScriptBaseLineNumber(JSDContext* jsdc, JSDScript *jsdscript); extern unsigned jsd_GetScriptLineExtent(JSDContext* jsdc, JSDScript *jsdscript); -extern JSBool +extern bool jsd_SetScriptHook(JSDContext* jsdc, JSD_ScriptHookProc hook, void* callerdata); -extern JSBool +extern bool jsd_GetScriptHook(JSDContext* jsdc, JSD_ScriptHookProc* hook, void** callerdata); extern uintptr_t @@ -416,7 +416,7 @@ jsd_GetClosestPC(JSDContext* jsdc, JSDScript* jsdscript, unsigned line); extern unsigned jsd_GetClosestLine(JSDContext* jsdc, JSDScript* jsdscript, uintptr_t pc); -extern JSBool +extern bool jsd_GetLinePCs(JSDContext* jsdc, JSDScript* jsdscript, unsigned startLine, unsigned maxLines, unsigned* count, unsigned** lines, uintptr_t** pcs); @@ -438,22 +438,22 @@ jsd_DestroyScriptHookProc( /* Script execution hook functions */ -extern JSBool +extern bool jsd_SetExecutionHook(JSDContext* jsdc, JSDScript* jsdscript, uintptr_t pc, JSD_ExecutionHookProc hook, void* callerdata); -extern JSBool +extern bool jsd_ClearExecutionHook(JSDContext* jsdc, JSDScript* jsdscript, uintptr_t pc); -extern JSBool +extern bool jsd_ClearAllExecutionHooksForScript(JSDContext* jsdc, JSDScript* jsdscript); -extern JSBool +extern bool jsd_ClearAllExecutionHooks(JSDContext* jsdc); extern void @@ -481,7 +481,7 @@ jsd_FindSourceForURL(JSDContext* jsdc, const char* url); extern const char* jsd_GetSourceURL(JSDContext* jsdc, JSDSourceText* jsdsrc); -extern JSBool +extern bool jsd_GetSourceText(JSDContext* jsdc, JSDSourceText* jsdsrc, const char** ppBuf, int* pLen); @@ -491,11 +491,11 @@ jsd_ClearSourceText(JSDContext* jsdc, JSDSourceText* jsdsrc); extern JSDSourceStatus jsd_GetSourceStatus(JSDContext* jsdc, JSDSourceText* jsdsrc); -extern JSBool +extern bool jsd_IsSourceDirty(JSDContext* jsdc, JSDSourceText* jsdsrc); extern void -jsd_SetSourceDirty(JSDContext* jsdc, JSDSourceText* jsdsrc, JSBool dirty); +jsd_SetSourceDirty(JSDContext* jsdc, JSDSourceText* jsdsrc, bool dirty); extern unsigned jsd_GetSourceAlterCount(JSDContext* jsdc, JSDSourceText* jsdsrc); @@ -521,7 +521,7 @@ jsd_AppendUCSourceText(JSDContext* jsdc, JSDSourceStatus status); /* convienence function for adding complete source of url in one call */ -extern JSBool +extern bool jsd_AddFullSourceText(JSDContext* jsdc, const char* text, /* *not* zero terminated */ size_t length, @@ -542,33 +542,33 @@ jsd_FinishedEvalUsingFilename(JSDContext* jsdc, const char* url); /***************************************************************************/ /* Interrupt Hook functions */ -extern JSBool +extern bool jsd_SetInterruptHook(JSDContext* jsdc, JSD_ExecutionHookProc hook, void* callerdata); -extern JSBool +extern bool jsd_ClearInterruptHook(JSDContext* jsdc); -extern JSBool +extern bool jsd_EnableSingleStepInterrupts(JSDContext* jsdc, JSDScript* jsdscript, - JSBool enable); + bool enable); -extern JSBool +extern bool jsd_SetDebugBreakHook(JSDContext* jsdc, JSD_ExecutionHookProc hook, void* callerdata); -extern JSBool +extern bool jsd_ClearDebugBreakHook(JSDContext* jsdc); -extern JSBool +extern bool jsd_SetDebuggerHook(JSDContext* jsdc, JSD_ExecutionHookProc hook, void* callerdata); -extern JSBool +extern bool jsd_ClearDebuggerHook(JSDContext* jsdc); extern JSTrapStatus @@ -579,18 +579,18 @@ jsd_CallExecutionHook(JSDContext* jsdc, void* hookData, jsval* rval); -extern JSBool +extern bool jsd_CallCallHook (JSDContext* jsdc, JSContext* cx, unsigned type, JSD_CallHookProc hook, void* hookData); -extern JSBool +extern bool jsd_SetThrowHook(JSDContext* jsdc, JSD_ExecutionHookProc hook, void* callerdata); -extern JSBool +extern bool jsd_ClearThrowHook(JSDContext* jsdc); extern JSTrapStatus @@ -601,20 +601,20 @@ extern JSTrapStatus jsd_ThrowHandler(JSContext *cx, JSScript *script, jsbytecode *pc, jsval *rval, void *closure); -extern JSBool +extern bool jsd_SetFunctionHook(JSDContext* jsdc, JSD_CallHookProc hook, void* callerdata); -extern JSBool +extern bool jsd_ClearFunctionHook(JSDContext* jsdc); -extern JSBool +extern bool jsd_SetTopLevelHook(JSDContext* jsdc, JSD_CallHookProc hook, void* callerdata); -extern JSBool +extern bool jsd_ClearTopLevelHook(JSDContext* jsdc); /***************************************************************************/ @@ -654,12 +654,12 @@ jsd_GetScopeChainForStackFrame(JSDContext* jsdc, JSDThreadState* jsdthreadstate, JSDStackFrameInfo* jsdframe); -extern JSBool +extern bool jsd_IsStackFrameDebugger(JSDContext* jsdc, JSDThreadState* jsdthreadstate, JSDStackFrameInfo* jsdframe); -extern JSBool +extern bool jsd_IsStackFrameConstructing(JSDContext* jsdc, JSDThreadState* jsdthreadstate, JSDStackFrameInfo* jsdframe); @@ -680,21 +680,21 @@ jsd_NewThreadState(JSDContext* jsdc, JSContext *cx); extern void jsd_DestroyThreadState(JSDContext* jsdc, JSDThreadState* jsdthreadstate); -extern JSBool +extern bool jsd_EvaluateUCScriptInStackFrame(JSDContext* jsdc, JSDThreadState* jsdthreadstate, JSDStackFrameInfo* jsdframe, const jschar *bytes, unsigned length, const char *filename, unsigned lineno, - JSBool eatExceptions, JS::MutableHandleValue rval); + bool eatExceptions, JS::MutableHandleValue rval); -extern JSBool +extern bool jsd_EvaluateScriptInStackFrame(JSDContext* jsdc, JSDThreadState* jsdthreadstate, JSDStackFrameInfo* jsdframe, const char *bytes, unsigned length, const char *filename, unsigned lineno, - JSBool eatExceptions, JS::MutableHandleValue rval); + bool eatExceptions, JS::MutableHandleValue rval); extern JSString* jsd_ValToStringInStackFrame(JSDContext* jsdc, @@ -702,11 +702,11 @@ jsd_ValToStringInStackFrame(JSDContext* jsdc, JSDStackFrameInfo* jsdframe, jsval val); -extern JSBool +extern bool jsd_IsValidThreadState(JSDContext* jsdc, JSDThreadState* jsdthreadstate); -extern JSBool +extern bool jsd_IsValidFrameInThreadState(JSDContext* jsdc, JSDThreadState* jsdthreadstate, JSDStackFrameInfo* jsdframe); @@ -714,7 +714,7 @@ jsd_IsValidFrameInThreadState(JSDContext* jsdc, extern JSDValue* jsd_GetException(JSDContext* jsdc, JSDThreadState* jsdthreadstate); -extern JSBool +extern bool jsd_SetException(JSDContext* jsdc, JSDThreadState* jsdthreadstate, JSDValue* jsdval); @@ -867,42 +867,42 @@ jsd_RefreshValue(JSDContext* jsdc, JSDValue* jsdval); /**************************************************/ -extern JSBool +extern bool jsd_IsValueObject(JSDContext* jsdc, JSDValue* jsdval); -extern JSBool +extern bool jsd_IsValueNumber(JSDContext* jsdc, JSDValue* jsdval); -extern JSBool +extern bool jsd_IsValueInt(JSDContext* jsdc, JSDValue* jsdval); -extern JSBool +extern bool jsd_IsValueDouble(JSDContext* jsdc, JSDValue* jsdval); -extern JSBool +extern bool jsd_IsValueString(JSDContext* jsdc, JSDValue* jsdval); -extern JSBool +extern bool jsd_IsValueBoolean(JSDContext* jsdc, JSDValue* jsdval); -extern JSBool +extern bool jsd_IsValueNull(JSDContext* jsdc, JSDValue* jsdval); -extern JSBool +extern bool jsd_IsValueVoid(JSDContext* jsdc, JSDValue* jsdval); -extern JSBool +extern bool jsd_IsValuePrimitive(JSDContext* jsdc, JSDValue* jsdval); -extern JSBool +extern bool jsd_IsValueFunction(JSDContext* jsdc, JSDValue* jsdval); -extern JSBool +extern bool jsd_IsValueNative(JSDContext* jsdc, JSDValue* jsdval); /**************************************************/ -extern JSBool +extern bool jsd_GetValueBoolean(JSDContext* jsdc, JSDValue* jsdval); extern int32_t @@ -968,16 +968,16 @@ jsd_GetPropertyFlags(JSDContext* jsdc, JSDProperty* jsdprop); extern void * jsd_FunctionCallHook(JSContext *cx, JSAbstractFramePtr frame, bool isConstructing, - JSBool before, JSBool *ok, void *closure); + bool before, bool *ok, void *closure); extern void * jsd_TopLevelCallHook(JSContext *cx, JSAbstractFramePtr frame, bool isConstructing, - JSBool before, JSBool *ok, void *closure); + bool before, bool *ok, void *closure); /**************************************************/ /* Object Functions */ -extern JSBool +extern bool jsd_InitObjectManager(JSDContext* jsdc); extern void @@ -1026,7 +1026,7 @@ jsd_GetValueForObject(JSDContext* jsdc, JSDObject* jsdobj); /**************************************************/ /* Atom Functions */ -extern JSBool +extern bool jsd_CreateAtomTable(JSDContext* jsdc); extern void diff --git a/js/jsd/jsd_atom.cpp b/js/jsd/jsd_atom.cpp index dec6b391457a8..31df05909c0e4 100644 --- a/js/jsd/jsd_atom.cpp +++ b/js/jsd/jsd_atom.cpp @@ -63,7 +63,7 @@ _compareAtoms(const void *v1, const void *v2) } -JSBool +bool jsd_CreateAtomTable(JSDContext* jsdc) { jsdc->atoms = JS_NewHashTable(256, JS_HashString, diff --git a/js/jsd/jsd_high.cpp b/js/jsd/jsd_high.cpp index 539108ce9e3b5..32b258f75e9ef 100644 --- a/js/jsd/jsd_high.cpp +++ b/js/jsd/jsd_high.cpp @@ -60,7 +60,7 @@ static JSClass global_class = { JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, global_finalize }; -static JSBool +static bool _validateUserCallbacks(JSD_UserCallbacks* callbacks) { return !callbacks || @@ -236,7 +236,7 @@ jsd_DebuggerOff(JSDContext* jsdc) } void -jsd_DebuggerPause(JSDContext* jsdc, JSBool forceAllHooksOff) +jsd_DebuggerPause(JSDContext* jsdc, bool forceAllHooksOff) { JS_SetDebuggerHandler(jsdc->jsrt, NULL, NULL); if (forceAllHooksOff || !(jsdc->flags & JSD_COLLECT_PROFILE_DATA)) { @@ -247,7 +247,7 @@ jsd_DebuggerPause(JSDContext* jsdc, JSBool forceAllHooksOff) JS_SetDebugErrorHook(jsdc->jsrt, NULL, NULL); } -static JSBool +static bool jsd_DebugErrorHook(JSContext *cx, const char *message, JSErrorReport *report, void *closure); @@ -328,7 +328,7 @@ jsd_JSDContextForJSContext(JSContext* context) return jsdc; } -static JSBool +static bool jsd_DebugErrorHook(JSContext *cx, const char *message, JSErrorReport *report, void *closure) { @@ -387,7 +387,7 @@ jsd_DebugErrorHook(JSContext *cx, const char *message, return true; } -JSBool +bool jsd_SetErrorReporter(JSDContext* jsdc, JSD_ErrorReporter reporter, void* callerdata) @@ -399,7 +399,7 @@ jsd_SetErrorReporter(JSDContext* jsdc, return true; } -JSBool +bool jsd_GetErrorReporter(JSDContext* jsdc, JSD_ErrorReporter* reporter, void** callerdata) diff --git a/js/jsd/jsd_hook.cpp b/js/jsd/jsd_hook.cpp index 19fce9b51d0c4..63bd0adfbbf84 100644 --- a/js/jsd/jsd_hook.cpp +++ b/js/jsd/jsd_hook.cpp @@ -165,14 +165,14 @@ jsd_CallExecutionHook(JSDContext* jsdc, return JSTRAP_CONTINUE; } -JSBool +bool jsd_CallCallHook (JSDContext* jsdc, JSContext *cx, unsigned type, JSD_CallHookProc hook, void* hookData) { - JSBool hookanswer; + bool hookanswer; JSDThreadState* jsdthreadstate; hookanswer = false; @@ -185,7 +185,7 @@ jsd_CallCallHook (JSDContext* jsdc, return hookanswer; } -JSBool +bool jsd_SetInterruptHook(JSDContext* jsdc, JSD_ExecutionHookProc hook, void* callerdata) @@ -199,7 +199,7 @@ jsd_SetInterruptHook(JSDContext* jsdc, return true; } -JSBool +bool jsd_ClearInterruptHook(JSDContext* jsdc) { JSD_LOCK(); @@ -210,7 +210,7 @@ jsd_ClearInterruptHook(JSDContext* jsdc) return true; } -JSBool +bool jsd_SetDebugBreakHook(JSDContext* jsdc, JSD_ExecutionHookProc hook, void* callerdata) @@ -223,7 +223,7 @@ jsd_SetDebugBreakHook(JSDContext* jsdc, return true; } -JSBool +bool jsd_ClearDebugBreakHook(JSDContext* jsdc) { JSD_LOCK(); @@ -233,7 +233,7 @@ jsd_ClearDebugBreakHook(JSDContext* jsdc) return true; } -JSBool +bool jsd_SetDebuggerHook(JSDContext* jsdc, JSD_ExecutionHookProc hook, void* callerdata) @@ -246,7 +246,7 @@ jsd_SetDebuggerHook(JSDContext* jsdc, return true; } -JSBool +bool jsd_ClearDebuggerHook(JSDContext* jsdc) { JSD_LOCK(); @@ -256,7 +256,7 @@ jsd_ClearDebuggerHook(JSDContext* jsdc) return true; } -JSBool +bool jsd_SetThrowHook(JSDContext* jsdc, JSD_ExecutionHookProc hook, void* callerdata) @@ -269,7 +269,7 @@ jsd_SetThrowHook(JSDContext* jsdc, return true; } -JSBool +bool jsd_ClearThrowHook(JSDContext* jsdc) { JSD_LOCK(); @@ -279,7 +279,7 @@ jsd_ClearThrowHook(JSDContext* jsdc) return true; } -JSBool +bool jsd_SetFunctionHook(JSDContext* jsdc, JSD_CallHookProc hook, void* callerdata) @@ -292,7 +292,7 @@ jsd_SetFunctionHook(JSDContext* jsdc, return true; } -JSBool +bool jsd_ClearFunctionHook(JSDContext* jsdc) { JSD_LOCK(); @@ -302,7 +302,7 @@ jsd_ClearFunctionHook(JSDContext* jsdc) return true; } -JSBool +bool jsd_SetTopLevelHook(JSDContext* jsdc, JSD_CallHookProc hook, void* callerdata) @@ -315,7 +315,7 @@ jsd_SetTopLevelHook(JSDContext* jsdc, return true; } -JSBool +bool jsd_ClearTopLevelHook(JSDContext* jsdc) { JSD_LOCK(); diff --git a/js/jsd/jsd_java.cpp b/js/jsd/jsd_java.cpp index c5c0aec2aaf93..43e55e40aca0c 100644 --- a/js/jsd/jsd_java.cpp +++ b/js/jsd/jsd_java.cpp @@ -109,9 +109,9 @@ _scriptObFromJSDScriptPtr( ExecEnv* ee, JSDScript* jsdscript ) /***************************************************************************/ void -_scriptHook( JSDContext* jsdc, +_scriptHook( JSDContext* jsdc, JSDScript* jsdscript, - JSBool creating, + bool creating, void* callerdata ) { Hnetscape_jsdebug_Script* script; @@ -430,7 +430,7 @@ struct Hjava_lang_String *netscape_jsdebug_DebugController_executeScriptInStackF char* srcC; JSString* jsstr; jsval rval; - JSBool success; + bool success; int srclen; threadStateOb = (struct Hnetscape_jsdebug_JSThreadState*)unhand(frame)->threadState; diff --git a/js/jsd/jsd_lock.cpp b/js/jsd/jsd_lock.cpp index 5ff7fbe9e1ed8..89d5cf8add3cd 100644 --- a/js/jsd/jsd_lock.cpp +++ b/js/jsd/jsd_lock.cpp @@ -142,7 +142,7 @@ jsd_Unlock(JSDStaticLock* lock) } #ifdef DEBUG -JSBool +bool jsd_IsLocked(JSDStaticLock* lock) { void* me; @@ -194,7 +194,7 @@ jsd_Unlock(void* lock) } #ifdef DEBUG -JSBool +bool jsd_IsLocked(void* lock) { return true; diff --git a/js/jsd/jsd_lock.h b/js/jsd/jsd_lock.h index b1e8c31053bd8..4b0ac0838d465 100644 --- a/js/jsd/jsd_lock.h +++ b/js/jsd/jsd_lock.h @@ -33,7 +33,7 @@ extern void jsd_Unlock(JSDStaticLock* lock); #ifdef DEBUG -extern JSBool +extern bool jsd_IsLocked(JSDStaticLock* lock); #endif /* DEBUG */ diff --git a/js/jsd/jsd_obj.cpp b/js/jsd/jsd_obj.cpp index a27b5331ebfcf..df68ef92209a4 100644 --- a/js/jsd/jsd_obj.cpp +++ b/js/jsd/jsd_obj.cpp @@ -123,7 +123,7 @@ _hash_root(const void *key) return ((JSHashNumber)(ptrdiff_t) key) >> 2; /* help lame MSVC1.5 on Win16 */ } -JSBool +bool jsd_InitObjectManager(JSDContext* jsdc) { JS_INIT_CLIST(&jsdc->objectsList); diff --git a/js/jsd/jsd_scpt.cpp b/js/jsd/jsd_scpt.cpp index b6a8fc6092bc4..4ab907d195684 100644 --- a/js/jsd/jsd_scpt.cpp +++ b/js/jsd/jsd_scpt.cpp @@ -195,7 +195,7 @@ static JSHashAllocOps script_alloc_ops = { #define JSD_SCRIPT_HASH_SIZE 1024 #endif -JSBool +bool jsd_InitScriptManager(JSDContext* jsdc) { JS_INIT_CLIST(&jsdc->scripts); @@ -393,7 +393,7 @@ jsd_GetScriptPrivate(JSDScript *jsdscript) return jsdscript->data; } -JSBool +bool jsd_IsActiveScript(JSDContext* jsdc, JSDScript *jsdscript) { JSDScript *current; @@ -481,14 +481,14 @@ jsd_GetClosestLine(JSDContext* jsdc, JSDScript* jsdscript, uintptr_t pc) return line; } -JSBool +bool jsd_GetLinePCs(JSDContext* jsdc, JSDScript* jsdscript, unsigned startLine, unsigned maxLines, unsigned* count, unsigned** retLines, uintptr_t** retPCs) { unsigned first = jsdscript->lineBase; unsigned last = first + jsd_GetScriptLineExtent(jsdc, jsdscript) - 1; - JSBool ok; + bool ok; jsbytecode **pcs; unsigned i; @@ -515,7 +515,7 @@ jsd_GetLinePCs(JSDContext* jsdc, JSDScript* jsdscript, return ok; } -JSBool +bool jsd_SetScriptHook(JSDContext* jsdc, JSD_ScriptHookProc hook, void* callerdata) { JSD_LOCK(); @@ -525,7 +525,7 @@ jsd_SetScriptHook(JSDContext* jsdc, JSD_ScriptHookProc hook, void* callerdata) return true; } -JSBool +bool jsd_GetScriptHook(JSDContext* jsdc, JSD_ScriptHookProc* hook, void** callerdata) { JSD_LOCK(); @@ -537,10 +537,10 @@ jsd_GetScriptHook(JSDContext* jsdc, JSD_ScriptHookProc* hook, void** callerdata) return true; } -JSBool -jsd_EnableSingleStepInterrupts(JSDContext* jsdc, JSDScript* jsdscript, JSBool enable) +bool +jsd_EnableSingleStepInterrupts(JSDContext* jsdc, JSDScript* jsdscript, bool enable) { - JSBool rv; + bool rv; AutoSafeJSContext cx; JSAutoCompartment ac(cx, jsdscript->script); JSD_LOCK(); @@ -667,7 +667,7 @@ _findHook(JSDContext* jsdc, JSDScript* jsdscript, uintptr_t pc) return NULL; } -static JSBool +static bool _isActiveHook(JSDContext* jsdc, JSScript *script, JSDExecHook* jsdhook) { JSDExecHook* current; @@ -741,7 +741,7 @@ jsd_TrapHandler(JSContext *cx, JSScript *script_, jsbytecode *pc, jsval *rval, -JSBool +bool jsd_SetExecutionHook(JSDContext* jsdc, JSDScript* jsdscript, uintptr_t pc, @@ -749,7 +749,7 @@ jsd_SetExecutionHook(JSDContext* jsdc, void* callerdata) { JSDExecHook* jsdhook; - JSBool rv; + bool rv; JSD_LOCK(); if( ! hook ) @@ -799,7 +799,7 @@ jsd_SetExecutionHook(JSDContext* jsdc, return true; } -JSBool +bool jsd_ClearExecutionHook(JSDContext* jsdc, JSDScript* jsdscript, uintptr_t pc) @@ -829,7 +829,7 @@ jsd_ClearExecutionHook(JSDContext* jsdc, return true; } -JSBool +bool jsd_ClearAllExecutionHooksForScript(JSDContext* jsdc, JSDScript* jsdscript) { JSDExecHook* jsdhook; @@ -848,7 +848,7 @@ jsd_ClearAllExecutionHooksForScript(JSDContext* jsdc, JSDScript* jsdscript) return true; } -JSBool +bool jsd_ClearAllExecutionHooks(JSDContext* jsdc) { JSDScript* jsdscript; diff --git a/js/jsd/jsd_stak.cpp b/js/jsd/jsd_stak.cpp index 14b37ca9d84ed..0b562d31606ef 100644 --- a/js/jsd/jsd_stak.cpp +++ b/js/jsd/jsd_stak.cpp @@ -314,7 +314,7 @@ jsd_GetThisForStackFrame(JSDContext* jsdc, if( jsd_IsValidFrameInThreadState(jsdc, jsdthreadstate, jsdframe) ) { - JSBool ok; + bool ok; JS::RootedValue thisval(jsdthreadstate->context); JS_BeginRequest(jsdthreadstate->context); ok = jsdframe->frame.getThisValue(jsdthreadstate->context, &thisval); @@ -356,12 +356,12 @@ jsd_GetIdForStackFrame(JSDContext* jsdc, return rv; } -JSBool +bool jsd_IsStackFrameDebugger(JSDContext* jsdc, JSDThreadState* jsdthreadstate, JSDStackFrameInfo* jsdframe) { - JSBool rv = true; + bool rv = true; JSD_LOCK_THREADSTATES(jsdc); if( jsd_IsValidFrameInThreadState(jsdc, jsdthreadstate, jsdframe) ) @@ -373,12 +373,12 @@ jsd_IsStackFrameDebugger(JSDContext* jsdc, return rv; } -JSBool +bool jsd_IsStackFrameConstructing(JSDContext* jsdc, JSDThreadState* jsdthreadstate, JSDStackFrameInfo* jsdframe) { - JSBool rv = true; + bool rv = true; JSD_LOCK_THREADSTATES(jsdc); if( jsd_IsValidFrameInThreadState(jsdc, jsdthreadstate, jsdframe) ) @@ -390,16 +390,16 @@ jsd_IsStackFrameConstructing(JSDContext* jsdc, return rv; } -JSBool +bool jsd_EvaluateUCScriptInStackFrame(JSDContext* jsdc, JSDThreadState* jsdthreadstate, JSDStackFrameInfo* jsdframe, const jschar *bytes, unsigned length, const char *filename, unsigned lineno, - JSBool eatExceptions, JS::MutableHandleValue rval) + bool eatExceptions, JS::MutableHandleValue rval) { - JSBool retval; - JSBool valid; + bool retval; + bool valid; JSExceptionState* exceptionState = NULL; JS_ASSERT(JSD_CURRENT_THREAD() == jsdthreadstate->thread); @@ -427,16 +427,16 @@ jsd_EvaluateUCScriptInStackFrame(JSDContext* jsdc, return retval; } -JSBool +bool jsd_EvaluateScriptInStackFrame(JSDContext* jsdc, JSDThreadState* jsdthreadstate, JSDStackFrameInfo* jsdframe, const char *bytes, unsigned length, const char *filename, unsigned lineno, - JSBool eatExceptions, JS::MutableHandleValue rval) + bool eatExceptions, JS::MutableHandleValue rval) { - JSBool retval; - JSBool valid; + bool retval; + bool valid; JSExceptionState* exceptionState = NULL; JS_ASSERT(JSD_CURRENT_THREAD() == jsdthreadstate->thread); @@ -470,7 +470,7 @@ jsd_ValToStringInStackFrame(JSDContext* jsdc, JSDStackFrameInfo* jsdframe, jsval val) { - JSBool valid; + bool valid; JSString* retval; JSExceptionState* exceptionState; JSContext* cx; @@ -492,7 +492,7 @@ jsd_ValToStringInStackFrame(JSDContext* jsdc, return retval; } -JSBool +bool jsd_IsValidThreadState(JSDContext* jsdc, JSDThreadState* jsdthreadstate) { @@ -510,7 +510,7 @@ jsd_IsValidThreadState(JSDContext* jsdc, return false; } -JSBool +bool jsd_IsValidFrameInThreadState(JSDContext* jsdc, JSDThreadState* jsdthreadstate, JSDStackFrameInfo* jsdframe) @@ -531,7 +531,7 @@ jsd_IsValidFrameInThreadState(JSDContext* jsdc, static JSContext* _getContextForThreadState(JSDContext* jsdc, JSDThreadState* jsdthreadstate) { - JSBool valid; + bool valid; JSD_LOCK_THREADSTATES(jsdc); valid = jsd_IsValidThreadState(jsdc, jsdthreadstate); JSD_UNLOCK_THREADSTATES(jsdc); @@ -554,7 +554,7 @@ jsd_GetException(JSDContext* jsdc, JSDThreadState* jsdthreadstate) return NULL; } -JSBool +bool jsd_SetException(JSDContext* jsdc, JSDThreadState* jsdthreadstate, JSDValue* jsdval) { diff --git a/js/jsd/jsd_step.cpp b/js/jsd/jsd_step.cpp index 0778ce43e155f..8852f01ab3446 100644 --- a/js/jsd/jsd_step.cpp +++ b/js/jsd/jsd_step.cpp @@ -33,7 +33,7 @@ _indentSpaces(int i) static void _interpreterTrace(JSDContext* jsdc, JSContext *cx, JSAbstractFramePtr frame, - bool isConstructing, JSBool before) + bool isConstructing, bool before) { JSDScript* jsdscript = NULL; JSScript * script; @@ -76,13 +76,13 @@ _interpreterTrace(JSDContext* jsdc, JSContext *cx, JSAbstractFramePtr frame, } #endif -JSBool +bool _callHook(JSDContext *jsdc, JSContext *cx, JSAbstractFramePtr frame, bool isConstructing, - JSBool before, unsigned type, JSD_CallHookProc hook, void *hookData) + bool before, unsigned type, JSD_CallHookProc hook, void *hookData) { JSDScript* jsdscript; JSScript* jsscript; - JSBool hookresult = true; + bool hookresult = true; if (!jsdc || !jsdc->inited) return false; @@ -234,7 +234,7 @@ _callHook(JSDContext *jsdc, JSContext *cx, JSAbstractFramePtr frame, bool isCons void * jsd_FunctionCallHook(JSContext *cx, JSAbstractFramePtr frame, bool isConstructing, - JSBool before, JSBool *ok, void *closure) + bool before, bool *ok, void *closure) { JSDContext* jsdc; JSD_CallHookProc hook; @@ -260,7 +260,7 @@ jsd_FunctionCallHook(JSContext *cx, JSAbstractFramePtr frame, bool isConstructin void * jsd_TopLevelCallHook(JSContext *cx, JSAbstractFramePtr frame, bool isConstructing, - JSBool before, JSBool *ok, void *closure) + bool before, bool *ok, void *closure) { JSDContext* jsdc; JSD_CallHookProc hook; diff --git a/js/jsd/jsd_text.cpp b/js/jsd/jsd_text.cpp index 8358c9330da88..d4cfa17008d39 100644 --- a/js/jsd/jsd_text.cpp +++ b/js/jsd/jsd_text.cpp @@ -36,7 +36,7 @@ _clearText(JSDContext* jsdc, JSDSourceText* jsdsrc) jsdsrc->doingEval = false; } -static JSBool +static bool _appendText(JSDContext* jsdc, JSDSourceText* jsdsrc, const char* text, size_t length) { @@ -135,7 +135,7 @@ _removeSourceFromRemovedList( JSDContext* jsdc, JSDSourceText* jsdsrc ) _destroySource( jsdc, jsdsrc ); } -static JSBool +static bool _isSourceInSourceList(JSDContext* jsdc, JSDSourceText* jsdsrcToFind) { JSDSourceText *jsdsrc; @@ -255,7 +255,7 @@ jsd_GetSourceURL(JSDContext* jsdc, JSDSourceText* jsdsrc) return jsdsrc->url; } -JSBool +bool jsd_GetSourceText(JSDContext* jsdc, JSDSourceText* jsdsrc, const char** ppBuf, int* pLen ) { @@ -280,14 +280,14 @@ jsd_GetSourceStatus(JSDContext* jsdc, JSDSourceText* jsdsrc) return jsdsrc->status; } -JSBool +bool jsd_IsSourceDirty(JSDContext* jsdc, JSDSourceText* jsdsrc) { return jsdsrc->dirty; } void -jsd_SetSourceDirty(JSDContext* jsdc, JSDSourceText* jsdsrc, JSBool dirty) +jsd_SetSourceDirty(JSDContext* jsdc, JSDSourceText* jsdsrc, bool dirty) { jsdsrc->dirty = dirty; } @@ -318,9 +318,9 @@ void DEBUG_ITERATE_SOURCES( JSDContext* jsdc ) const char* url; const char* text; int len; - JSBool dirty; + bool dirty; JSDStreamStatus status; - JSBool gotSrc; + bool gotSrc; url = JSD_GetSourceURL(jsdc, jsdsrc); dirty = JSD_IsSourceDirty(jsdc, jsdsrc); @@ -452,7 +452,7 @@ jsd_AppendUCSourceText(JSDContext* jsdc, } /* convienence function for adding complete source of url in one call */ -JSBool +bool jsd_AddFullSourceText(JSDContext* jsdc, const char* text, /* *not* zero terminated */ size_t length, diff --git a/js/jsd/jsd_val.cpp b/js/jsd/jsd_val.cpp index 75a60b08fbaad..2298de32d80bc 100644 --- a/js/jsd/jsd_val.cpp +++ b/js/jsd/jsd_val.cpp @@ -57,61 +57,61 @@ void JSD_ASSERT_VALID_PROPERTY(JSDProperty* jsdprop) #endif -JSBool +bool jsd_IsValueObject(JSDContext* jsdc, JSDValue* jsdval) { return !JSVAL_IS_PRIMITIVE(jsdval->val) || JSVAL_IS_NULL(jsdval->val); } -JSBool +bool jsd_IsValueNumber(JSDContext* jsdc, JSDValue* jsdval) { return JSVAL_IS_NUMBER(jsdval->val); } -JSBool +bool jsd_IsValueInt(JSDContext* jsdc, JSDValue* jsdval) { return JSVAL_IS_INT(jsdval->val); } -JSBool +bool jsd_IsValueDouble(JSDContext* jsdc, JSDValue* jsdval) { return JSVAL_IS_DOUBLE(jsdval->val); } -JSBool +bool jsd_IsValueString(JSDContext* jsdc, JSDValue* jsdval) { return JSVAL_IS_STRING(jsdval->val); } -JSBool +bool jsd_IsValueBoolean(JSDContext* jsdc, JSDValue* jsdval) { return JSVAL_IS_BOOLEAN(jsdval->val); } -JSBool +bool jsd_IsValueNull(JSDContext* jsdc, JSDValue* jsdval) { return JSVAL_IS_NULL(jsdval->val); } -JSBool +bool jsd_IsValueVoid(JSDContext* jsdc, JSDValue* jsdval) { return JSVAL_IS_VOID(jsdval->val); } -JSBool +bool jsd_IsValuePrimitive(JSDContext* jsdc, JSDValue* jsdval) { return JSVAL_IS_PRIMITIVE(jsdval->val); } -JSBool +bool jsd_IsValueFunction(JSDContext* jsdc, JSDValue* jsdval) { AutoSafeJSContext cx; // NB: Actually unused. @@ -119,7 +119,7 @@ jsd_IsValueFunction(JSDContext* jsdc, JSDValue* jsdval) JS_ObjectIsCallable(cx, JSVAL_TO_OBJECT(jsdval->val)); } -JSBool +bool jsd_IsValueNative(JSDContext* jsdc, JSDValue* jsdval) { AutoSafeJSContext cx; @@ -129,7 +129,7 @@ jsd_IsValueNative(JSDContext* jsdc, JSDValue* jsdval) { JSAutoCompartment ac(cx, JSVAL_TO_OBJECT(jsdval->val)); AutoSaveExceptionState as(cx); - JSBool ok = false; + bool ok = false; fun = JSD_GetValueFunction(jsdc, jsdval); if(fun) ok = JS_GetFunctionScript(cx, fun) ? false : true; @@ -141,7 +141,7 @@ jsd_IsValueNative(JSDContext* jsdc, JSDValue* jsdval) /***************************************************************************/ -JSBool +bool jsd_GetValueBoolean(JSDContext* jsdc, JSDValue* jsdval) { jsval val = jsdval->val; @@ -248,7 +248,7 @@ jsd_NewValue(JSDContext* jsdc, jsval value) if(JSVAL_IS_GCTHING(val)) { - JSBool ok; + bool ok; JSAutoCompartment ac(cx, jsdc->glob); ok = JS_AddNamedValueRoot(cx, &jsdval->val, "JSDValue"); @@ -351,7 +351,7 @@ static void _freeProps(JSDContext* jsdc, JSDValue* jsdval) CLEAR_BIT_FLAG(jsdval->flags, GOT_PROPS); } -static JSBool _buildProps(JSDContext* jsdc, JSDValue* jsdval) +static bool _buildProps(JSDContext* jsdc, JSDValue* jsdval) { AutoSafeJSContext cx; JS::RootedObject obj(cx); @@ -469,7 +469,7 @@ jsd_GetValueProperty(JSDContext* jsdc, JSDValue* jsdval, JSString* nameStr) JS::RootedObject obj(cx); JS::RootedString name(cx, nameStr); unsigned attrs = 0; - JSBool found; + bool found; JSPropertyDesc pd; const jschar * nameChars; size_t nameLen; diff --git a/js/jsd/jsd_xpc.cpp b/js/jsd/jsd_xpc.cpp index 2b2181b757753..cda4d546600d0 100644 --- a/js/jsd/jsd_xpc.cpp +++ b/js/jsd/jsd_xpc.cpp @@ -537,7 +537,7 @@ jsds_ErrorHookProc (JSDContext *jsdc, JSContext *cx, const char *message, return JSD_ERROR_REPORTER_PASS_ALONG; } -static JSBool +static bool jsds_CallHookProc (JSDContext* jsdc, JSDThreadState* jsdthreadstate, unsigned type, void* callerdata) { @@ -652,7 +652,7 @@ jsds_ExecutionHookProc (JSDContext* jsdc, JSDThreadState* jsdthreadstate, } static void -jsds_ScriptHookProc (JSDContext* jsdc, JSDScript* jsdscript, JSBool creating, +jsds_ScriptHookProc (JSDContext* jsdc, JSDScript* jsdscript, bool creating, void* callerdata) { #ifdef CAUTIOUS_SCRIPTHOOK diff --git a/js/jsd/jsdebug.cpp b/js/jsd/jsdebug.cpp index 85aedafe76d9c..e0f7655c51635 100644 --- a/js/jsd/jsdebug.cpp +++ b/js/jsd/jsdebug.cpp @@ -262,7 +262,7 @@ JSD_GetScriptPrivate(JSDScript *jsdscript) } -JSD_PUBLIC_API(JSBool) +JSD_PUBLIC_API(bool) JSD_IsActiveScript(JSDContext* jsdc, JSDScript *jsdscript) { JSD_ASSERT_VALID_CONTEXT(jsdc); @@ -301,14 +301,14 @@ JSD_GetScriptLineExtent(JSDContext* jsdc, JSDScript *jsdscript) return jsd_GetScriptLineExtent(jsdc, jsdscript); } -JSD_PUBLIC_API(JSBool) +JSD_PUBLIC_API(bool) JSD_SetScriptHook(JSDContext* jsdc, JSD_ScriptHookProc hook, void* callerdata) { JSD_ASSERT_VALID_CONTEXT(jsdc); return jsd_SetScriptHook(jsdc, hook, callerdata); } -JSD_PUBLIC_API(JSBool) +JSD_PUBLIC_API(bool) JSD_GetScriptHook(JSDContext* jsdc, JSD_ScriptHookProc* hook, void** callerdata) { JSD_ASSERT_VALID_CONTEXT(jsdc); @@ -331,7 +331,7 @@ JSD_GetClosestLine(JSDContext* jsdc, JSDScript* jsdscript, uintptr_t pc) return jsd_GetClosestLine(jsdc, jsdscript, pc); } -JSD_PUBLIC_API(JSBool) +JSD_PUBLIC_API(bool) JSD_GetLinePCs(JSDContext* jsdc, JSDScript* jsdscript, unsigned startLine, unsigned maxLines, unsigned* count, unsigned** lines, uintptr_t** pcs) @@ -402,7 +402,7 @@ JSD_GetSourceURL(JSDContext* jsdc, JSDSourceText* jsdsrc) return jsd_GetSourceURL(jsdc,jsdsrc); } -JSD_PUBLIC_API(JSBool) +JSD_PUBLIC_API(bool) JSD_GetSourceText(JSDContext* jsdc, JSDSourceText* jsdsrc, const char** ppBuf, int* pLen) { @@ -430,7 +430,7 @@ JSD_GetSourceStatus(JSDContext* jsdc, JSDSourceText* jsdsrc) return jsd_GetSourceStatus(jsdc, jsdsrc); } -JSD_PUBLIC_API(JSBool) +JSD_PUBLIC_API(bool) JSD_IsSourceDirty(JSDContext* jsdc, JSDSourceText* jsdsrc) { JSD_ASSERT_VALID_CONTEXT(jsdc); @@ -439,7 +439,7 @@ JSD_IsSourceDirty(JSDContext* jsdc, JSDSourceText* jsdsrc) } JSD_PUBLIC_API(void) -JSD_SetSourceDirty(JSDContext* jsdc, JSDSourceText* jsdsrc, JSBool dirty) +JSD_SetSourceDirty(JSDContext* jsdc, JSDSourceText* jsdsrc, bool dirty) { JSD_ASSERT_VALID_CONTEXT(jsdc); JSD_ASSERT_VALID_SOURCE_TEXT(jsdsrc); @@ -501,7 +501,7 @@ JSD_AppendUCSourceText(JSDContext* jsdc, return jsd_AppendUCSourceText(jsdc, jsdsrc, text, length, status); } -JSD_PUBLIC_API(JSBool) +JSD_PUBLIC_API(bool) JSD_AddFullSourceText(JSDContext* jsdc, const char* text, /* *not* zero terminated */ size_t length, @@ -515,7 +515,7 @@ JSD_AddFullSourceText(JSDContext* jsdc, /***************************************************************************/ /* Execution/Interrupt Hook functions */ -JSD_PUBLIC_API(JSBool) +JSD_PUBLIC_API(bool) JSD_SetExecutionHook(JSDContext* jsdc, JSDScript* jsdscript, uintptr_t pc, @@ -527,7 +527,7 @@ JSD_SetExecutionHook(JSDContext* jsdc, return jsd_SetExecutionHook(jsdc, jsdscript, pc, hook, callerdata); } -JSD_PUBLIC_API(JSBool) +JSD_PUBLIC_API(bool) JSD_ClearExecutionHook(JSDContext* jsdc, JSDScript* jsdscript, uintptr_t pc) @@ -537,7 +537,7 @@ JSD_ClearExecutionHook(JSDContext* jsdc, return jsd_ClearExecutionHook(jsdc, jsdscript, pc); } -JSD_PUBLIC_API(JSBool) +JSD_PUBLIC_API(bool) JSD_ClearAllExecutionHooksForScript(JSDContext* jsdc, JSDScript* jsdscript) { JSD_ASSERT_VALID_CONTEXT(jsdc); @@ -545,14 +545,14 @@ JSD_ClearAllExecutionHooksForScript(JSDContext* jsdc, JSDScript* jsdscript) return jsd_ClearAllExecutionHooksForScript(jsdc, jsdscript); } -JSD_PUBLIC_API(JSBool) +JSD_PUBLIC_API(bool) JSD_ClearAllExecutionHooks(JSDContext* jsdc) { JSD_ASSERT_VALID_CONTEXT(jsdc); return jsd_ClearAllExecutionHooks(jsdc); } -JSD_PUBLIC_API(JSBool) +JSD_PUBLIC_API(bool) JSD_SetInterruptHook(JSDContext* jsdc, JSD_ExecutionHookProc hook, void* callerdata) @@ -561,22 +561,22 @@ JSD_SetInterruptHook(JSDContext* jsdc, return jsd_SetInterruptHook(jsdc, hook, callerdata); } -JSD_PUBLIC_API(JSBool) -JSD_EnableSingleStepInterrupts(JSDContext* jsdc, JSDScript* jsdscript, JSBool enable) +JSD_PUBLIC_API(bool) +JSD_EnableSingleStepInterrupts(JSDContext* jsdc, JSDScript* jsdscript, bool enable) { JSD_ASSERT_VALID_CONTEXT(jsdc); JSD_ASSERT_VALID_SCRIPT(jsdscript); return jsd_EnableSingleStepInterrupts(jsdc, jsdscript, enable); } -JSD_PUBLIC_API(JSBool) +JSD_PUBLIC_API(bool) JSD_ClearInterruptHook(JSDContext* jsdc) { JSD_ASSERT_VALID_CONTEXT(jsdc); return jsd_ClearInterruptHook(jsdc); } -JSD_PUBLIC_API(JSBool) +JSD_PUBLIC_API(bool) JSD_SetDebugBreakHook(JSDContext* jsdc, JSD_ExecutionHookProc hook, void* callerdata) @@ -585,14 +585,14 @@ JSD_SetDebugBreakHook(JSDContext* jsdc, return jsd_SetDebugBreakHook(jsdc, hook, callerdata); } -JSD_PUBLIC_API(JSBool) +JSD_PUBLIC_API(bool) JSD_ClearDebugBreakHook(JSDContext* jsdc) { JSD_ASSERT_VALID_CONTEXT(jsdc); return jsd_ClearDebugBreakHook(jsdc); } -JSD_PUBLIC_API(JSBool) +JSD_PUBLIC_API(bool) JSD_SetDebuggerHook(JSDContext* jsdc, JSD_ExecutionHookProc hook, void* callerdata) @@ -601,14 +601,14 @@ JSD_SetDebuggerHook(JSDContext* jsdc, return jsd_SetDebuggerHook(jsdc, hook, callerdata); } -JSD_PUBLIC_API(JSBool) +JSD_PUBLIC_API(bool) JSD_ClearDebuggerHook(JSDContext* jsdc) { JSD_ASSERT_VALID_CONTEXT(jsdc); return jsd_ClearDebuggerHook(jsdc); } -JSD_PUBLIC_API(JSBool) +JSD_PUBLIC_API(bool) JSD_SetThrowHook(JSDContext* jsdc, JSD_ExecutionHookProc hook, void* callerdata) @@ -617,14 +617,14 @@ JSD_SetThrowHook(JSDContext* jsdc, return jsd_SetThrowHook(jsdc, hook, callerdata); } -JSD_PUBLIC_API(JSBool) +JSD_PUBLIC_API(bool) JSD_ClearThrowHook(JSDContext* jsdc) { JSD_ASSERT_VALID_CONTEXT(jsdc); return jsd_ClearThrowHook(jsdc); } -JSD_PUBLIC_API(JSBool) +JSD_PUBLIC_API(bool) JSD_SetTopLevelHook(JSDContext* jsdc, JSD_CallHookProc hook, void* callerdata) @@ -633,14 +633,14 @@ JSD_SetTopLevelHook(JSDContext* jsdc, return jsd_SetTopLevelHook(jsdc, hook, callerdata); } -JSD_PUBLIC_API(JSBool) +JSD_PUBLIC_API(bool) JSD_ClearTopLevelHook(JSDContext* jsdc) { JSD_ASSERT_VALID_CONTEXT(jsdc); return jsd_ClearTopLevelHook(jsdc); } -JSD_PUBLIC_API(JSBool) +JSD_PUBLIC_API(bool) JSD_SetFunctionHook(JSDContext* jsdc, JSD_CallHookProc hook, void* callerdata) @@ -649,7 +649,7 @@ JSD_SetFunctionHook(JSDContext* jsdc, return jsd_SetFunctionHook(jsdc, hook, callerdata); } -JSD_PUBLIC_API(JSBool) +JSD_PUBLIC_API(bool) JSD_ClearFunctionHook(JSDContext* jsdc) { JSD_ASSERT_VALID_CONTEXT(jsdc); @@ -743,7 +743,7 @@ JSD_GetIdForStackFrame(JSDContext* jsdc, return jsd_GetIdForStackFrame(jsdc, jsdthreadstate, jsdframe); } -JSD_PUBLIC_API(JSBool) +JSD_PUBLIC_API(bool) JSD_IsStackFrameDebugger(JSDContext* jsdc, JSDThreadState* jsdthreadstate, JSDStackFrameInfo* jsdframe) @@ -752,7 +752,7 @@ JSD_IsStackFrameDebugger(JSDContext* jsdc, return jsd_IsStackFrameDebugger(jsdc, jsdthreadstate, jsdframe); } -JSD_PUBLIC_API(JSBool) +JSD_PUBLIC_API(bool) JSD_IsStackFrameConstructing(JSDContext* jsdc, JSDThreadState* jsdthreadstate, JSDStackFrameInfo* jsdframe) @@ -761,7 +761,7 @@ JSD_IsStackFrameConstructing(JSDContext* jsdc, return jsd_IsStackFrameConstructing(jsdc, jsdthreadstate, jsdframe); } -JSD_PUBLIC_API(JSBool) +JSD_PUBLIC_API(bool) JSD_EvaluateUCScriptInStackFrame(JSDContext* jsdc, JSDThreadState* jsdthreadstate, JSDStackFrameInfo* jsdframe, @@ -778,7 +778,7 @@ JSD_EvaluateUCScriptInStackFrame(JSDContext* jsdc, true, rval); } -JSD_PUBLIC_API(JSBool) +JSD_PUBLIC_API(bool) JSD_AttemptUCScriptInStackFrame(JSDContext* jsdc, JSDThreadState* jsdthreadstate, JSDStackFrameInfo* jsdframe, @@ -796,7 +796,7 @@ JSD_AttemptUCScriptInStackFrame(JSDContext* jsdc, false, rval); } -JSD_PUBLIC_API(JSBool) +JSD_PUBLIC_API(bool) JSD_EvaluateScriptInStackFrame(JSDContext* jsdc, JSDThreadState* jsdthreadstate, JSDStackFrameInfo* jsdframe, @@ -813,7 +813,7 @@ JSD_EvaluateScriptInStackFrame(JSDContext* jsdc, filename, lineno, true, rval); } -JSD_PUBLIC_API(JSBool) +JSD_PUBLIC_API(bool) JSD_AttemptScriptInStackFrame(JSDContext* jsdc, JSDThreadState* jsdthreadstate, JSDStackFrameInfo* jsdframe, @@ -847,7 +847,7 @@ JSD_GetException(JSDContext* jsdc, JSDThreadState* jsdthreadstate) return jsd_GetException(jsdc, jsdthreadstate); } -extern JSD_PUBLIC_API(JSBool) +extern JSD_PUBLIC_API(bool) JSD_SetException(JSDContext* jsdc, JSDThreadState* jsdthreadstate, JSDValue* jsdval) { @@ -857,7 +857,7 @@ JSD_SetException(JSDContext* jsdc, JSDThreadState* jsdthreadstate, /***************************************************************************/ -JSD_PUBLIC_API(JSBool) +JSD_PUBLIC_API(bool) JSD_SetErrorReporter(JSDContext* jsdc, JSD_ErrorReporter reporter, void* callerdata) @@ -866,7 +866,7 @@ JSD_SetErrorReporter(JSDContext* jsdc, return jsd_SetErrorReporter(jsdc, reporter, callerdata); } -JSD_PUBLIC_API(JSBool) +JSD_PUBLIC_API(bool) JSD_GetErrorReporter(JSDContext* jsdc, JSD_ErrorReporter* reporter, void** callerdata) @@ -877,7 +877,7 @@ JSD_GetErrorReporter(JSDContext* jsdc, /***************************************************************************/ -JSD_PUBLIC_API(JSBool) +JSD_PUBLIC_API(bool) JSD_IsLockingAndThreadIdSupported() { #ifdef JSD_THREADSAFE @@ -913,7 +913,7 @@ JSD_Unlock(JSDStaticLock* lock) #endif } -JSD_PUBLIC_API(JSBool) +JSD_PUBLIC_API(bool) JSD_IsLocked(JSDStaticLock* lock) { #if defined(JSD_THREADSAFE) && defined(DEBUG) @@ -923,7 +923,7 @@ JSD_IsLocked(JSDStaticLock* lock) #endif } -JSD_PUBLIC_API(JSBool) +JSD_PUBLIC_API(bool) JSD_IsUnlocked(JSDStaticLock* lock) { #if defined(JSD_THREADSAFE) && defined(DEBUG) @@ -975,7 +975,7 @@ JSD_RefreshValue(JSDContext* jsdc, JSDValue* jsdval) /**************************************************/ -JSD_PUBLIC_API(JSBool) +JSD_PUBLIC_API(bool) JSD_IsValueObject(JSDContext* jsdc, JSDValue* jsdval) { JSD_ASSERT_VALID_CONTEXT(jsdc); @@ -983,7 +983,7 @@ JSD_IsValueObject(JSDContext* jsdc, JSDValue* jsdval) return jsd_IsValueObject(jsdc, jsdval); } -JSD_PUBLIC_API(JSBool) +JSD_PUBLIC_API(bool) JSD_IsValueNumber(JSDContext* jsdc, JSDValue* jsdval) { JSD_ASSERT_VALID_CONTEXT(jsdc); @@ -991,7 +991,7 @@ JSD_IsValueNumber(JSDContext* jsdc, JSDValue* jsdval) return jsd_IsValueNumber(jsdc, jsdval); } -JSD_PUBLIC_API(JSBool) +JSD_PUBLIC_API(bool) JSD_IsValueInt(JSDContext* jsdc, JSDValue* jsdval) { JSD_ASSERT_VALID_CONTEXT(jsdc); @@ -999,7 +999,7 @@ JSD_IsValueInt(JSDContext* jsdc, JSDValue* jsdval) return jsd_IsValueInt(jsdc, jsdval); } -JSD_PUBLIC_API(JSBool) +JSD_PUBLIC_API(bool) JSD_IsValueDouble(JSDContext* jsdc, JSDValue* jsdval) { JSD_ASSERT_VALID_CONTEXT(jsdc); @@ -1007,7 +1007,7 @@ JSD_IsValueDouble(JSDContext* jsdc, JSDValue* jsdval) return jsd_IsValueDouble(jsdc, jsdval); } -JSD_PUBLIC_API(JSBool) +JSD_PUBLIC_API(bool) JSD_IsValueString(JSDContext* jsdc, JSDValue* jsdval) { JSD_ASSERT_VALID_CONTEXT(jsdc); @@ -1015,7 +1015,7 @@ JSD_IsValueString(JSDContext* jsdc, JSDValue* jsdval) return jsd_IsValueString(jsdc, jsdval); } -JSD_PUBLIC_API(JSBool) +JSD_PUBLIC_API(bool) JSD_IsValueBoolean(JSDContext* jsdc, JSDValue* jsdval) { JSD_ASSERT_VALID_CONTEXT(jsdc); @@ -1023,7 +1023,7 @@ JSD_IsValueBoolean(JSDContext* jsdc, JSDValue* jsdval) return jsd_IsValueBoolean(jsdc, jsdval); } -JSD_PUBLIC_API(JSBool) +JSD_PUBLIC_API(bool) JSD_IsValueNull(JSDContext* jsdc, JSDValue* jsdval) { JSD_ASSERT_VALID_CONTEXT(jsdc); @@ -1031,7 +1031,7 @@ JSD_IsValueNull(JSDContext* jsdc, JSDValue* jsdval) return jsd_IsValueNull(jsdc, jsdval); } -JSD_PUBLIC_API(JSBool) +JSD_PUBLIC_API(bool) JSD_IsValueVoid(JSDContext* jsdc, JSDValue* jsdval) { JSD_ASSERT_VALID_CONTEXT(jsdc); @@ -1039,7 +1039,7 @@ JSD_IsValueVoid(JSDContext* jsdc, JSDValue* jsdval) return jsd_IsValueVoid(jsdc, jsdval); } -JSD_PUBLIC_API(JSBool) +JSD_PUBLIC_API(bool) JSD_IsValuePrimitive(JSDContext* jsdc, JSDValue* jsdval) { JSD_ASSERT_VALID_CONTEXT(jsdc); @@ -1047,7 +1047,7 @@ JSD_IsValuePrimitive(JSDContext* jsdc, JSDValue* jsdval) return jsd_IsValuePrimitive(jsdc, jsdval); } -JSD_PUBLIC_API(JSBool) +JSD_PUBLIC_API(bool) JSD_IsValueFunction(JSDContext* jsdc, JSDValue* jsdval) { JSD_ASSERT_VALID_CONTEXT(jsdc); @@ -1055,7 +1055,7 @@ JSD_IsValueFunction(JSDContext* jsdc, JSDValue* jsdval) return jsd_IsValueFunction(jsdc, jsdval); } -JSD_PUBLIC_API(JSBool) +JSD_PUBLIC_API(bool) JSD_IsValueNative(JSDContext* jsdc, JSDValue* jsdval) { JSD_ASSERT_VALID_CONTEXT(jsdc); @@ -1065,7 +1065,7 @@ JSD_IsValueNative(JSDContext* jsdc, JSDValue* jsdval) /**************************************************/ -JSD_PUBLIC_API(JSBool) +JSD_PUBLIC_API(bool) JSD_GetValueBoolean(JSDContext* jsdc, JSDValue* jsdval) { JSD_ASSERT_VALID_CONTEXT(jsdc); diff --git a/js/jsd/jsdebug.h b/js/jsd/jsdebug.h index 7252108ec23d7..2a36d58c35ee2 100644 --- a/js/jsd/jsdebug.h +++ b/js/jsd/jsdebug.h @@ -385,7 +385,7 @@ JSD_GetScriptPrivate(JSDScript* jsdscript); /* * Determine if this script is still loaded in the interpreter */ -extern JSD_PUBLIC_API(JSBool) +extern JSD_PUBLIC_API(bool) JSD_IsActiveScript(JSDContext* jsdc, JSDScript *jsdscript); /* @@ -425,7 +425,7 @@ JSD_GetScriptLineExtent(JSDContext* jsdc, JSDScript *jsdscript); typedef void (* JSD_ScriptHookProc)(JSDContext* jsdc, JSDScript* jsdscript, - JSBool creating, + bool creating, void* callerdata); /* @@ -433,13 +433,13 @@ typedef void * unloaded). * 'callerdata' can be whatever you want it to be. */ -extern JSD_PUBLIC_API(JSBool) +extern JSD_PUBLIC_API(bool) JSD_SetScriptHook(JSDContext* jsdc, JSD_ScriptHookProc hook, void* callerdata); /* * Get the current script hook. */ -extern JSD_PUBLIC_API(JSBool) +extern JSD_PUBLIC_API(bool) JSD_GetScriptHook(JSDContext* jsdc, JSD_ScriptHookProc* hook, void** callerdata); /* @@ -468,7 +468,7 @@ JSD_GetClosestLine(JSDContext* jsdc, JSDScript* jsdscript, uintptr_t pc); * may be passed for either lines or pcs to avoid filling anything in for that * argument. */ -extern JSD_PUBLIC_API(JSBool) +extern JSD_PUBLIC_API(bool) JSD_GetLinePCs(JSDContext* jsdc, JSDScript* jsdscript, unsigned startLine, unsigned maxLines, unsigned* count, unsigned** lines, uintptr_t** pcs); @@ -575,7 +575,7 @@ JSD_GetSourceURL(JSDContext* jsdc, JSDSourceText* jsdsrc); * hold a zero terminating char). * XXX this is 8-bit character data. Unicode source is not yet supported. */ -extern JSD_PUBLIC_API(JSBool) +extern JSD_PUBLIC_API(bool) JSD_GetSourceText(JSDContext* jsdc, JSDSourceText* jsdsrc, const char** ppBuf, int* pLen); @@ -600,14 +600,14 @@ JSD_GetSourceStatus(JSDContext* jsdc, JSDSourceText* jsdsrc); * discouraged in favor of the JSD_GetSourceAlterCount system. This dirty * scheme ASSUMES that there is only one consumer of the data. */ -extern JSD_PUBLIC_API(JSBool) +extern JSD_PUBLIC_API(bool) JSD_IsSourceDirty(JSDContext* jsdc, JSDSourceText* jsdsrc); /* * Clear the dirty flag */ extern JSD_PUBLIC_API(void) -JSD_SetSourceDirty(JSDContext* jsdc, JSDSourceText* jsdsrc, JSBool dirty); +JSD_SetSourceDirty(JSDContext* jsdc, JSDSourceText* jsdsrc, bool dirty); /* * Each time a source text item is altered this value is incremented. Any @@ -685,7 +685,7 @@ JSD_AppendUCSourceText(JSDContext* jsdc, * JSD_UNLOCK_SOURCE_TEXT(jsdc); * return jsdsrc ? true : false; */ -extern JSD_PUBLIC_API(JSBool) +extern JSD_PUBLIC_API(bool) JSD_AddFullSourceText(JSDContext* jsdc, const char* text, /* *not* zero terminated */ size_t length, @@ -731,7 +731,7 @@ typedef unsigned * want to hear about the TOPLEVEL_END or FUNCTION_RETURN too. Return value is * ignored to TOPLEVEL_END and FUNCTION_RETURN type hooks. */ -typedef JSBool +typedef bool (* JSD_CallHookProc)(JSDContext* jsdc, JSDThreadState* jsdthreadstate, unsigned type, @@ -741,7 +741,7 @@ typedef JSBool * Set Hook to be called whenever the given pc is about to be executed -- * i.e. for 'trap' or 'breakpoint' */ -extern JSD_PUBLIC_API(JSBool) +extern JSD_PUBLIC_API(bool) JSD_SetExecutionHook(JSDContext* jsdc, JSDScript* jsdscript, uintptr_t pc, @@ -751,7 +751,7 @@ JSD_SetExecutionHook(JSDContext* jsdc, /* * Clear the hook for this pc */ -extern JSD_PUBLIC_API(JSBool) +extern JSD_PUBLIC_API(bool) JSD_ClearExecutionHook(JSDContext* jsdc, JSDScript* jsdscript, uintptr_t pc); @@ -759,14 +759,14 @@ JSD_ClearExecutionHook(JSDContext* jsdc, /* * Clear all the pc specific hooks for this script */ -extern JSD_PUBLIC_API(JSBool) +extern JSD_PUBLIC_API(bool) JSD_ClearAllExecutionHooksForScript(JSDContext* jsdc, JSDScript* jsdscript); /* * Clear all the pc specific hooks for the entire JSRuntime associated with * this JSDContext */ -extern JSD_PUBLIC_API(JSBool) +extern JSD_PUBLIC_API(bool) JSD_ClearAllExecutionHooks(JSDContext* jsdc); /* @@ -776,7 +776,7 @@ JSD_ClearAllExecutionHooks(JSDContext* jsdc); * future time. The hook will continue to be called as each instruction * executes until cleared. */ -extern JSD_PUBLIC_API(JSBool) +extern JSD_PUBLIC_API(bool) JSD_SetInterruptHook(JSDContext* jsdc, JSD_ExecutionHookProc hook, void* callerdata); @@ -784,20 +784,20 @@ JSD_SetInterruptHook(JSDContext* jsdc, /* * Call the interrupt hook at least once per source line */ -extern JSD_PUBLIC_API(JSBool) -JSD_EnableSingleStepInterrupts(JSDContext* jsdc, JSDScript *jsdscript, JSBool enable); +extern JSD_PUBLIC_API(bool) +JSD_EnableSingleStepInterrupts(JSDContext* jsdc, JSDScript *jsdscript, bool enable); /* * Clear the current interrupt hook. */ -extern JSD_PUBLIC_API(JSBool) +extern JSD_PUBLIC_API(bool) JSD_ClearInterruptHook(JSDContext* jsdc); /* * Set the hook that should be called whenever a JSD_ErrorReporter hook * returns JSD_ERROR_REPORTER_DEBUG. */ -extern JSD_PUBLIC_API(JSBool) +extern JSD_PUBLIC_API(bool) JSD_SetDebugBreakHook(JSDContext* jsdc, JSD_ExecutionHookProc hook, void* callerdata); @@ -805,14 +805,14 @@ JSD_SetDebugBreakHook(JSDContext* jsdc, /* * Clear the debug break hook */ -extern JSD_PUBLIC_API(JSBool) +extern JSD_PUBLIC_API(bool) JSD_ClearDebugBreakHook(JSDContext* jsdc); /* * Set the hook that should be called when the 'debugger' keyword is * encountered by the JavaScript interpreter during execution. */ -extern JSD_PUBLIC_API(JSBool) +extern JSD_PUBLIC_API(bool) JSD_SetDebuggerHook(JSDContext* jsdc, JSD_ExecutionHookProc hook, void* callerdata); @@ -820,47 +820,47 @@ JSD_SetDebuggerHook(JSDContext* jsdc, /* * Clear the 'debugger' keyword hook */ -extern JSD_PUBLIC_API(JSBool) +extern JSD_PUBLIC_API(bool) JSD_ClearDebuggerHook(JSDContext* jsdc); /* * Set the hook that should be called when a JS exception is thrown. * NOTE: the 'do default' return value is: JSD_HOOK_RETURN_CONTINUE_THROW */ -extern JSD_PUBLIC_API(JSBool) +extern JSD_PUBLIC_API(bool) JSD_SetThrowHook(JSDContext* jsdc, JSD_ExecutionHookProc hook, void* callerdata); /* * Clear the throw hook */ -extern JSD_PUBLIC_API(JSBool) +extern JSD_PUBLIC_API(bool) JSD_ClearThrowHook(JSDContext* jsdc); /* * Set the hook that should be called when a toplevel script begins or completes. */ -extern JSD_PUBLIC_API(JSBool) +extern JSD_PUBLIC_API(bool) JSD_SetTopLevelHook(JSDContext* jsdc, JSD_CallHookProc hook, void* callerdata); /* * Clear the toplevel call hook */ -extern JSD_PUBLIC_API(JSBool) +extern JSD_PUBLIC_API(bool) JSD_ClearTopLevelHook(JSDContext* jsdc); /* * Set the hook that should be called when a function call or return happens. */ -extern JSD_PUBLIC_API(JSBool) +extern JSD_PUBLIC_API(bool) JSD_SetFunctionHook(JSDContext* jsdc, JSD_CallHookProc hook, void* callerdata); /* * Clear the function call hook */ -extern JSD_PUBLIC_API(JSBool) +extern JSD_PUBLIC_API(bool) JSD_ClearFunctionHook(JSDContext* jsdc); /***************************************************************************/ @@ -950,7 +950,7 @@ JSD_GetIdForStackFrame(JSDContext* jsdc, * True if stack frame represents a frame created as a result of a debugger * evaluation. */ -extern JSD_PUBLIC_API(JSBool) +extern JSD_PUBLIC_API(bool) JSD_IsStackFrameDebugger(JSDContext* jsdc, JSDThreadState* jsdthreadstate, JSDStackFrameInfo* jsdframe); @@ -958,7 +958,7 @@ JSD_IsStackFrameDebugger(JSDContext* jsdc, /* * True if stack frame is constructing a new object. */ -extern JSD_PUBLIC_API(JSBool) +extern JSD_PUBLIC_API(bool) JSD_IsStackFrameConstructing(JSDContext* jsdc, JSDThreadState* jsdthreadstate, JSDStackFrameInfo* jsdframe); @@ -968,7 +968,7 @@ JSD_IsStackFrameConstructing(JSDContext* jsdc, * returns true and puts result in rval on success, false on failure. * NOTE: The ErrorReporter hook might be called if this fails. */ -extern JSD_PUBLIC_API(JSBool) +extern JSD_PUBLIC_API(bool) JSD_EvaluateUCScriptInStackFrame(JSDContext* jsdc, JSDThreadState* jsdthreadstate, JSDStackFrameInfo* jsdframe, @@ -979,7 +979,7 @@ JSD_EvaluateUCScriptInStackFrame(JSDContext* jsdc, /* * Same as above, but does not eat exceptions. */ -extern JSD_PUBLIC_API(JSBool) +extern JSD_PUBLIC_API(bool) JSD_AttemptUCScriptInStackFrame(JSDContext* jsdc, JSDThreadState* jsdthreadstate, JSDStackFrameInfo* jsdframe, @@ -988,7 +988,7 @@ JSD_AttemptUCScriptInStackFrame(JSDContext* jsdc, JS::MutableHandleValue rval); /* single byte character version of JSD_EvaluateUCScriptInStackFrame */ -extern JSD_PUBLIC_API(JSBool) +extern JSD_PUBLIC_API(bool) JSD_EvaluateScriptInStackFrame(JSDContext* jsdc, JSDThreadState* jsdthreadstate, JSDStackFrameInfo* jsdframe, @@ -998,7 +998,7 @@ JSD_EvaluateScriptInStackFrame(JSDContext* jsdc, /* * Same as above, but does not eat exceptions. */ -extern JSD_PUBLIC_API(JSBool) +extern JSD_PUBLIC_API(bool) JSD_AttemptScriptInStackFrame(JSDContext* jsdc, JSDThreadState* jsdthreadstate, JSDStackFrameInfo* jsdframe, @@ -1027,7 +1027,7 @@ JSD_GetException(JSDContext* jsdc, JSDThreadState* jsdthreadstate); * Set the JSDValue currently being thrown as an exception. * *** new for version 1.1 **** */ -extern JSD_PUBLIC_API(JSBool) +extern JSD_PUBLIC_API(bool) JSD_SetException(JSDContext* jsdc, JSDThreadState* jsdthreadstate, JSDValue* jsdval); @@ -1056,13 +1056,13 @@ typedef unsigned void* callerdata); /* Set ErrorReporter hook */ -extern JSD_PUBLIC_API(JSBool) +extern JSD_PUBLIC_API(bool) JSD_SetErrorReporter(JSDContext* jsdc, JSD_ErrorReporter reporter, void* callerdata); /* Get Current ErrorReporter hook */ -extern JSD_PUBLIC_API(JSBool) +extern JSD_PUBLIC_API(bool) JSD_GetErrorReporter(JSDContext* jsdc, JSD_ErrorReporter* reporter, void** callerdata); @@ -1075,7 +1075,7 @@ struct JSDStaticLock; /* * Is Locking and GetThread supported in this build? */ -extern JSD_PUBLIC_API(JSBool) +extern JSD_PUBLIC_API(bool) JSD_IsLockingAndThreadIdSupported(); /* @@ -1102,13 +1102,13 @@ JSD_Unlock(JSDStaticLock* lock); * For debugging only if not (JS_THREADSAFE AND DEBUG) then returns true * So JSD_IsLocked(lock) may not equal !JSD_IsUnlocked(lock) */ -extern JSD_PUBLIC_API(JSBool) +extern JSD_PUBLIC_API(bool) JSD_IsLocked(JSDStaticLock* lock); /* * See above... */ -extern JSD_PUBLIC_API(JSBool) +extern JSD_PUBLIC_API(bool) JSD_IsUnlocked(JSDStaticLock* lock); /* @@ -1166,86 +1166,86 @@ JSD_RefreshValue(JSDContext* jsdc, JSDValue* jsdval); * Does the JSDValue wrap a JSObject? * *** new for version 1.1 **** */ -extern JSD_PUBLIC_API(JSBool) +extern JSD_PUBLIC_API(bool) JSD_IsValueObject(JSDContext* jsdc, JSDValue* jsdval); /* * Does the JSDValue wrap a number (int or double)? * *** new for version 1.1 **** */ -extern JSD_PUBLIC_API(JSBool) +extern JSD_PUBLIC_API(bool) JSD_IsValueNumber(JSDContext* jsdc, JSDValue* jsdval); /* * Does the JSDValue wrap an int? * *** new for version 1.1 **** */ -extern JSD_PUBLIC_API(JSBool) +extern JSD_PUBLIC_API(bool) JSD_IsValueInt(JSDContext* jsdc, JSDValue* jsdval); /* * Does the JSDValue wrap a double? * *** new for version 1.1 **** */ -extern JSD_PUBLIC_API(JSBool) +extern JSD_PUBLIC_API(bool) JSD_IsValueDouble(JSDContext* jsdc, JSDValue* jsdval); /* * Does the JSDValue wrap a JSString? * *** new for version 1.1 **** */ -extern JSD_PUBLIC_API(JSBool) +extern JSD_PUBLIC_API(bool) JSD_IsValueString(JSDContext* jsdc, JSDValue* jsdval); /* -* Does the JSDValue wrap a JSBool? +* Does the JSDValue wrap a bool? * *** new for version 1.1 **** */ -extern JSD_PUBLIC_API(JSBool) +extern JSD_PUBLIC_API(bool) JSD_IsValueBoolean(JSDContext* jsdc, JSDValue* jsdval); /* * Does the JSDValue wrap a JSVAL_NULL? * *** new for version 1.1 **** */ -extern JSD_PUBLIC_API(JSBool) +extern JSD_PUBLIC_API(bool) JSD_IsValueNull(JSDContext* jsdc, JSDValue* jsdval); /* * Does the JSDValue wrap a JSVAL_VOID? * *** new for version 1.1 **** */ -extern JSD_PUBLIC_API(JSBool) +extern JSD_PUBLIC_API(bool) JSD_IsValueVoid(JSDContext* jsdc, JSDValue* jsdval); /* * Does the JSDValue wrap a primative (not a JSObject)? * *** new for version 1.1 **** */ -extern JSD_PUBLIC_API(JSBool) +extern JSD_PUBLIC_API(bool) JSD_IsValuePrimitive(JSDContext* jsdc, JSDValue* jsdval); /* * Does the JSDValue wrap a function? * *** new for version 1.1 **** */ -extern JSD_PUBLIC_API(JSBool) +extern JSD_PUBLIC_API(bool) JSD_IsValueFunction(JSDContext* jsdc, JSDValue* jsdval); /* * Does the JSDValue wrap a native function? * *** new for version 1.1 **** */ -extern JSD_PUBLIC_API(JSBool) +extern JSD_PUBLIC_API(bool) JSD_IsValueNative(JSDContext* jsdc, JSDValue* jsdval); /**************************************************/ /* -* Return JSBool value (does NOT do conversion). +* Return bool value (does NOT do conversion). * *** new for version 1.1 **** */ -extern JSD_PUBLIC_API(JSBool) +extern JSD_PUBLIC_API(bool) JSD_GetValueBoolean(JSDContext* jsdc, JSDValue* jsdval); /* diff --git a/js/jsd/jshash.cpp b/js/jsd/jshash.cpp index e2a38538da7cd..80800990927c9 100644 --- a/js/jsd/jshash.cpp +++ b/js/jsd/jshash.cpp @@ -166,7 +166,7 @@ JS_HashTableRawLookup(JSHashTable *ht, JSHashNumber keyHash, const void *key) return hep; } -static JSBool +static bool Resize(JSHashTable *ht, uint32_t newshift) { size_t nb, nentries, i; @@ -289,7 +289,7 @@ JS_HashTableRawRemove(JSHashTable *ht, JSHashEntry **hep, JSHashEntry *he) } } -JSBool +bool JS_HashTableRemove(JSHashTable *ht, const void *key) { JSHashNumber keyHash; diff --git a/js/jsd/jshash.h b/js/jsd/jshash.h index 96e2a0bd2ecf7..b83bbf71c3ab7 100644 --- a/js/jsd/jshash.h +++ b/js/jsd/jshash.h @@ -93,7 +93,7 @@ JS_HashTableRawRemove(JSHashTable *ht, JSHashEntry **hep, JSHashEntry *he); extern JSHashEntry * JS_HashTableAdd(JSHashTable *ht, const void *key, void *value); -extern JSBool +extern bool JS_HashTableRemove(JSHashTable *ht, const void *key); extern int diff --git a/js/public/CallArgs.h b/js/public/CallArgs.h index e0a4dcaf65901..3155790563353 100644 --- a/js/public/CallArgs.h +++ b/js/public/CallArgs.h @@ -89,7 +89,7 @@ extern JS_PUBLIC_DATA(const HandleValue) UndefinedHandleValue; * return value for a function call. The principal way to create a * CallReceiver is using JS::CallReceiverFromVp: * - * static JSBool + * static bool * FunctionReturningThis(JSContext *cx, unsigned argc, JS::Value *vp) * { * JS::CallReceiver rec = JS::CallReceiverFromVp(vp); @@ -282,7 +282,7 @@ CallReceiverFromVp(Value *vp) * the function call's arguments. The principal way to create a CallArgs is * like so, using JS::CallArgsFromVp: * - * static JSBool + * static bool * FunctionReturningArgcTimesArg0(JSContext *cx, unsigned argc, JS::Value *vp) * { * JS::CallArgs args = JS::CallArgsFromVp(argc, vp); diff --git a/js/public/MemoryMetrics.h b/js/public/MemoryMetrics.h index 49a367377bdaf..c30ca4b50b842 100644 --- a/js/public/MemoryMetrics.h +++ b/js/public/MemoryMetrics.h @@ -516,7 +516,7 @@ class ObjectPrivateVisitor // A callback that gets a JSObject's nsISupports pointer, if it has one. // Note: this function does *not* addref |iface|. - typedef JSBool(*GetISupportsFun)(JSObject *obj, nsISupports **iface); + typedef bool(*GetISupportsFun)(JSObject *obj, nsISupports **iface); GetISupportsFun getISupports_; ObjectPrivateVisitor(GetISupportsFun getISupports) diff --git a/js/public/Value.h b/js/public/Value.h index 3afcbc3af340c..44d800507d8c6 100644 --- a/js/public/Value.h +++ b/js/public/Value.h @@ -248,7 +248,7 @@ typedef union jsval_layout union { int32_t i32; uint32_t u32; - JSBool boo; + uint32_t boo; // Don't use |bool| -- it must be four bytes. JSString *str; JSObject *obj; void *ptr; @@ -295,7 +295,7 @@ typedef union jsval_layout union { int32_t i32; uint32_t u32; - JSBool boo; + uint32_t boo; // Don't use |bool| -- it must be four bytes. JSString *str; JSObject *obj; void *ptr; @@ -349,7 +349,7 @@ BUILD_JSVAL(JSValueTag tag, uint32_t payload) return l; } -static inline JSBool +static inline bool JSVAL_IS_DOUBLE_IMPL(jsval_layout l) { return (uint32_t)l.s.tag <= (uint32_t)JSVAL_TAG_CLEAR; @@ -364,7 +364,7 @@ DOUBLE_TO_JSVAL_IMPL(double d) return l; } -static inline JSBool +static inline bool JSVAL_IS_INT32_IMPL(jsval_layout l) { return l.s.tag == JSVAL_TAG_INT32; @@ -385,7 +385,7 @@ INT32_TO_JSVAL_IMPL(int32_t i) return l; } -static inline JSBool +static inline bool JSVAL_IS_NUMBER_IMPL(jsval_layout l) { JSValueTag tag = l.s.tag; @@ -393,13 +393,13 @@ JSVAL_IS_NUMBER_IMPL(jsval_layout l) return (uint32_t)tag <= (uint32_t)JSVAL_UPPER_INCL_TAG_OF_NUMBER_SET; } -static inline JSBool +static inline bool JSVAL_IS_UNDEFINED_IMPL(jsval_layout l) { return l.s.tag == JSVAL_TAG_UNDEFINED; } -static inline JSBool +static inline bool JSVAL_IS_STRING_IMPL(jsval_layout l) { return l.s.tag == JSVAL_TAG_STRING; @@ -421,47 +421,46 @@ JSVAL_TO_STRING_IMPL(jsval_layout l) return l.s.payload.str; } -static inline JSBool +static inline bool JSVAL_IS_BOOLEAN_IMPL(jsval_layout l) { return l.s.tag == JSVAL_TAG_BOOLEAN; } -static inline JSBool +static inline bool JSVAL_TO_BOOLEAN_IMPL(jsval_layout l) { return l.s.payload.boo; } static inline jsval_layout -BOOLEAN_TO_JSVAL_IMPL(JSBool b) +BOOLEAN_TO_JSVAL_IMPL(bool b) { jsval_layout l; - MOZ_ASSERT(b == JS_TRUE_DEPRECATED || b == JS_FALSE_DEPRECATED); l.s.tag = JSVAL_TAG_BOOLEAN; l.s.payload.boo = b; return l; } -static inline JSBool +static inline bool JSVAL_IS_MAGIC_IMPL(jsval_layout l) { return l.s.tag == JSVAL_TAG_MAGIC; } -static inline JSBool +static inline bool JSVAL_IS_OBJECT_IMPL(jsval_layout l) { return l.s.tag == JSVAL_TAG_OBJECT; } -static inline JSBool +static inline bool JSVAL_IS_PRIMITIVE_IMPL(jsval_layout l) { return (uint32_t)l.s.tag < (uint32_t)JSVAL_UPPER_EXCL_TAG_OF_PRIMITIVE_SET; } -static inline JSBool +static inline bool JSVAL_IS_OBJECT_OR_NULL_IMPL(jsval_layout l) { MOZ_ASSERT((uint32_t)l.s.tag <= (uint32_t)JSVAL_TAG_OBJECT); @@ -484,7 +483,7 @@ OBJECT_TO_JSVAL_IMPL(JSObject *obj) return l; } -static inline JSBool +static inline bool JSVAL_IS_NULL_IMPL(jsval_layout l) { return l.s.tag == JSVAL_TAG_NULL; @@ -507,7 +506,7 @@ JSVAL_TO_PRIVATE_PTR_IMPL(jsval_layout l) return l.s.payload.ptr; } -static inline JSBool +static inline bool JSVAL_IS_GCTHING_IMPL(jsval_layout l) { /* gcc sometimes generates signed < without explicit casts. */ @@ -520,7 +519,7 @@ JSVAL_TO_GCTHING_IMPL(jsval_layout l) return l.s.payload.ptr; } -static inline JSBool +static inline bool JSVAL_IS_TRACEABLE_IMPL(jsval_layout l) { return l.s.tag == JSVAL_TAG_STRING || l.s.tag == JSVAL_TAG_OBJECT; @@ -529,19 +528,19 @@ JSVAL_IS_TRACEABLE_IMPL(jsval_layout l) static inline uint32_t JSVAL_TRACE_KIND_IMPL(jsval_layout l) { - return (uint32_t)(JSBool)JSVAL_IS_STRING_IMPL(l); + return (uint32_t)(bool)JSVAL_IS_STRING_IMPL(l); } -static inline JSBool +static inline bool JSVAL_IS_SPECIFIC_INT32_IMPL(jsval_layout l, int32_t i32) { return l.s.tag == JSVAL_TAG_INT32 && l.s.payload.i32 == i32; } -static inline JSBool -JSVAL_IS_SPECIFIC_BOOLEAN(jsval_layout l, JSBool b) +static inline bool +JSVAL_IS_SPECIFIC_BOOLEAN(jsval_layout l, bool b) { - return (l.s.tag == JSVAL_TAG_BOOLEAN) && (l.s.payload.boo == b); + return (l.s.tag == JSVAL_TAG_BOOLEAN) && (l.s.payload.boo == uint32_t(b)); } static inline jsval_layout @@ -553,7 +552,7 @@ MAGIC_TO_JSVAL_IMPL(JSWhyMagic why) return l; } -static inline JSBool +static inline bool JSVAL_SAME_TYPE_IMPL(jsval_layout lhs, jsval_layout rhs) { JSValueTag ltag = lhs.s.tag, rtag = rhs.s.tag; @@ -578,7 +577,7 @@ BUILD_JSVAL(JSValueTag tag, uint64_t payload) return l; } -static inline JSBool +static inline bool JSVAL_IS_DOUBLE_IMPL(jsval_layout l) { return l.asBits <= JSVAL_SHIFTED_TAG_MAX_DOUBLE; @@ -593,7 +592,7 @@ DOUBLE_TO_JSVAL_IMPL(double d) return l; } -static inline JSBool +static inline bool JSVAL_IS_INT32_IMPL(jsval_layout l) { return (uint32_t)(l.asBits >> JSVAL_TAG_SHIFT) == JSVAL_TAG_INT32; @@ -613,19 +612,19 @@ INT32_TO_JSVAL_IMPL(int32_t i32) return l; } -static inline JSBool +static inline bool JSVAL_IS_NUMBER_IMPL(jsval_layout l) { return l.asBits < JSVAL_UPPER_EXCL_SHIFTED_TAG_OF_NUMBER_SET; } -static inline JSBool +static inline bool JSVAL_IS_UNDEFINED_IMPL(jsval_layout l) { return l.asBits == JSVAL_SHIFTED_TAG_UNDEFINED; } -static inline JSBool +static inline bool JSVAL_IS_STRING_IMPL(jsval_layout l) { return (uint32_t)(l.asBits >> JSVAL_TAG_SHIFT) == JSVAL_TAG_STRING; @@ -648,47 +647,46 @@ JSVAL_TO_STRING_IMPL(jsval_layout l) return (JSString *)(l.asBits & JSVAL_PAYLOAD_MASK); } -static inline JSBool +static inline bool JSVAL_IS_BOOLEAN_IMPL(jsval_layout l) { return (uint32_t)(l.asBits >> JSVAL_TAG_SHIFT) == JSVAL_TAG_BOOLEAN; } -static inline JSBool +static inline bool JSVAL_TO_BOOLEAN_IMPL(jsval_layout l) { - return (JSBool)l.asBits; + return (bool)(l.asBits & JSVAL_PAYLOAD_MASK); } static inline jsval_layout -BOOLEAN_TO_JSVAL_IMPL(JSBool b) +BOOLEAN_TO_JSVAL_IMPL(bool b) { jsval_layout l; - MOZ_ASSERT(b == JS_TRUE_DEPRECATED || b == JS_FALSE_DEPRECATED); l.asBits = ((uint64_t)(uint32_t)b) | JSVAL_SHIFTED_TAG_BOOLEAN; return l; } -static inline JSBool +static inline bool JSVAL_IS_MAGIC_IMPL(jsval_layout l) { return (l.asBits >> JSVAL_TAG_SHIFT) == JSVAL_TAG_MAGIC; } -static inline JSBool +static inline bool JSVAL_IS_PRIMITIVE_IMPL(jsval_layout l) { return l.asBits < JSVAL_UPPER_EXCL_SHIFTED_TAG_OF_PRIMITIVE_SET; } -static inline JSBool +static inline bool JSVAL_IS_OBJECT_IMPL(jsval_layout l) { MOZ_ASSERT((l.asBits >> JSVAL_TAG_SHIFT) <= JSVAL_SHIFTED_TAG_OBJECT); return l.asBits >= JSVAL_SHIFTED_TAG_OBJECT; } -static inline JSBool +static inline bool JSVAL_IS_OBJECT_OR_NULL_IMPL(jsval_layout l) { MOZ_ASSERT((l.asBits >> JSVAL_TAG_SHIFT) <= JSVAL_TAG_OBJECT); @@ -714,13 +712,13 @@ OBJECT_TO_JSVAL_IMPL(JSObject *obj) return l; } -static inline JSBool +static inline bool JSVAL_IS_NULL_IMPL(jsval_layout l) { return l.asBits == JSVAL_SHIFTED_TAG_NULL; } -static inline JSBool +static inline bool JSVAL_IS_GCTHING_IMPL(jsval_layout l) { return l.asBits >= JSVAL_LOWER_INCL_SHIFTED_TAG_OF_GCTHING_SET; @@ -734,7 +732,7 @@ JSVAL_TO_GCTHING_IMPL(jsval_layout l) return (void *)ptrBits; } -static inline JSBool +static inline bool JSVAL_IS_TRACEABLE_IMPL(jsval_layout l) { return JSVAL_IS_GCTHING_IMPL(l) && !JSVAL_IS_NULL_IMPL(l); @@ -743,7 +741,7 @@ JSVAL_IS_TRACEABLE_IMPL(jsval_layout l) static inline uint32_t JSVAL_TRACE_KIND_IMPL(jsval_layout l) { - return (uint32_t)(JSBool)!(JSVAL_IS_OBJECT_IMPL(l)); + return (uint32_t)(bool)!(JSVAL_IS_OBJECT_IMPL(l)); } static inline jsval_layout @@ -764,14 +762,14 @@ JSVAL_TO_PRIVATE_PTR_IMPL(jsval_layout l) return (void *)(l.asBits << 1); } -static inline JSBool +static inline bool JSVAL_IS_SPECIFIC_INT32_IMPL(jsval_layout l, int32_t i32) { return l.asBits == (((uint64_t)(uint32_t)i32) | JSVAL_SHIFTED_TAG_INT32); } -static inline JSBool -JSVAL_IS_SPECIFIC_BOOLEAN(jsval_layout l, JSBool b) +static inline bool +JSVAL_IS_SPECIFIC_BOOLEAN(jsval_layout l, bool b) { return l.asBits == (((uint64_t)(uint32_t)b) | JSVAL_SHIFTED_TAG_BOOLEAN); } @@ -784,7 +782,7 @@ MAGIC_TO_JSVAL_IMPL(JSWhyMagic why) return l; } -static inline JSBool +static inline bool JSVAL_SAME_TYPE_IMPL(jsval_layout lhs, jsval_layout rhs) { uint64_t lbits = lhs.asBits, rbits = rhs.asBits; @@ -1167,7 +1165,6 @@ class Value void staticAssertions() { JS_STATIC_ASSERT(sizeof(JSValueType) == 1); JS_STATIC_ASSERT(sizeof(JSValueTag) == 4); - JS_STATIC_ASSERT(sizeof(JSBool) == 4); JS_STATIC_ASSERT(sizeof(JSWhyMagic) <= 4); JS_STATIC_ASSERT(sizeof(Value) == 8); } @@ -1669,19 +1666,19 @@ static_assert(sizeof(jsval_layout) == sizeof(JS::Value), /************************************************************************/ -static inline JSBool +static inline bool JSVAL_IS_NULL(jsval v) { return JSVAL_IS_NULL_IMPL(JSVAL_TO_IMPL(v)); } -static inline JSBool +static inline bool JSVAL_IS_VOID(jsval v) { return JSVAL_IS_UNDEFINED_IMPL(JSVAL_TO_IMPL(v)); } -static inline JSBool +static inline bool JSVAL_IS_INT(jsval v) { return JSVAL_IS_INT32_IMPL(JSVAL_TO_IMPL(v)); @@ -1700,7 +1697,7 @@ INT_TO_JSVAL(int32_t i) return IMPL_TO_JSVAL(INT32_TO_JSVAL_IMPL(i)); } -static inline JSBool +static inline bool JSVAL_IS_DOUBLE(jsval v) { return JSVAL_IS_DOUBLE_IMPL(JSVAL_TO_IMPL(v)); @@ -1740,13 +1737,13 @@ UINT_TO_JSVAL(uint32_t i) return DOUBLE_TO_JSVAL((double)i); } -static inline JSBool +static inline bool JSVAL_IS_NUMBER(jsval v) { return JSVAL_IS_NUMBER_IMPL(JSVAL_TO_IMPL(v)); } -static inline JSBool +static inline bool JSVAL_IS_STRING(jsval v) { return JSVAL_IS_STRING_IMPL(JSVAL_TO_IMPL(v)); @@ -1780,13 +1777,13 @@ OBJECT_TO_JSVAL(JSObject *obj) return IMPL_TO_JSVAL(BUILD_JSVAL(JSVAL_TAG_NULL, 0)); } -static inline JSBool +static inline bool JSVAL_IS_BOOLEAN(jsval v) { return JSVAL_IS_BOOLEAN_IMPL(JSVAL_TO_IMPL(v)); } -static inline JSBool +static inline bool JSVAL_TO_BOOLEAN(jsval v) { MOZ_ASSERT(JSVAL_IS_BOOLEAN(v)); @@ -1794,18 +1791,18 @@ JSVAL_TO_BOOLEAN(jsval v) } static inline jsval -BOOLEAN_TO_JSVAL(JSBool b) +BOOLEAN_TO_JSVAL(bool b) { return IMPL_TO_JSVAL(BOOLEAN_TO_JSVAL_IMPL(b)); } -static inline JSBool +static inline bool JSVAL_IS_PRIMITIVE(jsval v) { return JSVAL_IS_PRIMITIVE_IMPL(JSVAL_TO_IMPL(v)); } -static inline JSBool +static inline bool JSVAL_IS_GCTHING(jsval v) { return JSVAL_IS_GCTHING_IMPL(JSVAL_TO_IMPL(v)); diff --git a/js/src/builtin/BinaryData.cpp b/js/src/builtin/BinaryData.cpp index 344b1487fbced..2418adf139450 100644 --- a/js/src/builtin/BinaryData.cpp +++ b/js/src/builtin/BinaryData.cpp @@ -1124,7 +1124,7 @@ BinaryArray::fill(JSContext *cx, unsigned int argc, Value *vp) return FillBinaryArrayWithValue(cx, thisObj, val); } -JSBool +bool BinaryArray::obj_lookupGeneric(JSContext *cx, HandleObject obj, HandleId id, MutableHandleObject objp, MutableHandleShape propp) { @@ -1155,7 +1155,7 @@ BinaryArray::obj_lookupGeneric(JSContext *cx, HandleObject obj, HandleId id, return JSObject::lookupGeneric(cx, proto, id, objp, propp); } -JSBool +bool BinaryArray::obj_lookupProperty(JSContext *cx, HandleObject obj, HandlePropertyName name, @@ -1166,7 +1166,7 @@ BinaryArray::obj_lookupProperty(JSContext *cx, return obj_lookupGeneric(cx, obj, id, objp, propp); } -JSBool +bool BinaryArray::obj_lookupElement(JSContext *cx, HandleObject obj, uint32_t index, MutableHandleObject objp, MutableHandleShape propp) { @@ -1188,7 +1188,7 @@ BinaryArray::obj_lookupElement(JSContext *cx, HandleObject obj, uint32_t index, return true; } -JSBool +bool BinaryArray::obj_lookupSpecial(JSContext *cx, HandleObject obj, HandleSpecialId sid, MutableHandleObject objp, MutableHandleShape propp) @@ -1197,7 +1197,7 @@ BinaryArray::obj_lookupSpecial(JSContext *cx, HandleObject obj, return obj_lookupGeneric(cx, obj, id, objp, propp); } -JSBool +bool BinaryArray::obj_getGeneric(JSContext *cx, HandleObject obj, HandleObject receiver, HandleId id, MutableHandleValue vp) { @@ -1211,7 +1211,7 @@ BinaryArray::obj_getGeneric(JSContext *cx, HandleObject obj, HandleObject receiv return obj_getProperty(cx, obj, receiver, name, vp); } -JSBool +bool BinaryArray::obj_getProperty(JSContext *cx, HandleObject obj, HandleObject receiver, HandlePropertyName name, MutableHandleValue vp) { @@ -1224,7 +1224,7 @@ BinaryArray::obj_getProperty(JSContext *cx, HandleObject obj, HandleObject recei return JSObject::getProperty(cx, proto, receiver, name, vp); } -JSBool +bool BinaryArray::obj_getElement(JSContext *cx, HandleObject obj, HandleObject receiver, uint32_t index, MutableHandleValue vp) { @@ -1245,7 +1245,7 @@ BinaryArray::obj_getElement(JSContext *cx, HandleObject obj, HandleObject receiv return JSObject::getElement(cx, proto, receiver, index, vp); } -JSBool +bool BinaryArray::obj_getElementIfPresent(JSContext *cx, HandleObject obj, HandleObject receiver, uint32_t index, MutableHandleValue vp, bool *present) @@ -1262,7 +1262,7 @@ BinaryArray::obj_getElementIfPresent(JSContext *cx, HandleObject obj, return true; } -JSBool +bool BinaryArray::obj_getSpecial(JSContext *cx, HandleObject obj, HandleObject receiver, HandleSpecialId sid, MutableHandleValue vp) @@ -1271,9 +1271,9 @@ BinaryArray::obj_getSpecial(JSContext *cx, HandleObject obj, return obj_getGeneric(cx, obj, receiver, id, vp); } -JSBool +bool BinaryArray::obj_setGeneric(JSContext *cx, HandleObject obj, HandleId id, - MutableHandleValue vp, JSBool strict) + MutableHandleValue vp, bool strict) { uint32_t index; if (js_IdIsIndex(id, &index)) { @@ -1289,18 +1289,18 @@ BinaryArray::obj_setGeneric(JSContext *cx, HandleObject obj, HandleId id, return true; } -JSBool +bool BinaryArray::obj_setProperty(JSContext *cx, HandleObject obj, HandlePropertyName name, MutableHandleValue vp, - JSBool strict) + bool strict) { RootedId id(cx, NameToId(name)); return obj_setGeneric(cx, obj, id, vp, strict); } -JSBool +bool BinaryArray::obj_setElement(JSContext *cx, HandleObject obj, uint32_t index, - MutableHandleValue vp, JSBool strict) + MutableHandleValue vp, bool strict) { RootedObject type(cx, GetType(obj)); if (index >= ArrayType::length(cx, type)) { @@ -1328,16 +1328,16 @@ BinaryArray::obj_setElement(JSContext *cx, HandleObject obj, uint32_t index, return true; } -JSBool +bool BinaryArray::obj_setSpecial(JSContext *cx, HandleObject obj, HandleSpecialId sid, MutableHandleValue vp, - JSBool strict) + bool strict) { RootedId id(cx, SPECIALID_TO_JSID(sid)); return obj_setGeneric(cx, obj, id, vp, strict); } -JSBool +bool BinaryArray::obj_getGenericAttributes(JSContext *cx, HandleObject obj, HandleId id, unsigned *attrsp) { @@ -1358,7 +1358,7 @@ BinaryArray::obj_getGenericAttributes(JSContext *cx, HandleObject obj, return false; } -JSBool +bool BinaryArray::obj_getPropertyAttributes(JSContext *cx, HandleObject obj, HandlePropertyName name, unsigned *attrsp) @@ -1367,7 +1367,7 @@ BinaryArray::obj_getPropertyAttributes(JSContext *cx, HandleObject obj, return obj_getGenericAttributes(cx, obj, id, attrsp); } -JSBool +bool BinaryArray::obj_getElementAttributes(JSContext *cx, HandleObject obj, uint32_t index, unsigned *attrsp) { @@ -1375,7 +1375,7 @@ BinaryArray::obj_getElementAttributes(JSContext *cx, HandleObject obj, return obj_getGenericAttributes(cx, obj, id, attrsp); } -JSBool +bool BinaryArray::obj_getSpecialAttributes(JSContext *cx, HandleObject obj, HandleSpecialId sid, unsigned *attrsp) { @@ -1383,7 +1383,7 @@ BinaryArray::obj_getSpecialAttributes(JSContext *cx, HandleObject obj, return obj_getGenericAttributes(cx, obj, id, attrsp); } -JSBool +bool BinaryArray::obj_enumerate(JSContext *cx, HandleObject obj, JSIterateOp enum_op, MutableHandleValue statep, MutableHandleId idp) { @@ -1866,7 +1866,7 @@ BinaryStruct::obj_trace(JSTracer *tracer, JSObject *obj) MarkObject(tracer, &type, "binarystruct.type"); } -JSBool +bool BinaryStruct::obj_enumerate(JSContext *cx, HandleObject obj, JSIterateOp enum_op, MutableHandleValue statep, MutableHandleId idp) { @@ -1906,7 +1906,7 @@ BinaryStruct::obj_enumerate(JSContext *cx, HandleObject obj, JSIterateOp enum_op return true; } -JSBool +bool BinaryStruct::obj_getGeneric(JSContext *cx, HandleObject obj, HandleObject receiver, HandleId id, MutableHandleValue vp) @@ -1940,7 +1940,7 @@ BinaryStruct::obj_getGeneric(JSContext *cx, HandleObject obj, return Reify(cx, fieldType, obj, fieldInfo->offset, vp); } -JSBool +bool BinaryStruct::obj_getProperty(JSContext *cx, HandleObject obj, HandleObject receiver, HandlePropertyName name, MutableHandleValue vp) @@ -1949,7 +1949,7 @@ BinaryStruct::obj_getProperty(JSContext *cx, HandleObject obj, return obj_getGeneric(cx, obj, receiver, id, vp); } -JSBool +bool BinaryStruct::obj_getSpecial(JSContext *cx, HandleObject obj, HandleObject receiver, HandleSpecialId sid, MutableHandleValue vp) @@ -1958,9 +1958,9 @@ BinaryStruct::obj_getSpecial(JSContext *cx, HandleObject obj, return obj_getGeneric(cx, obj, receiver, id, vp); } -JSBool +bool BinaryStruct::obj_setGeneric(JSContext *cx, HandleObject obj, HandleId id, - MutableHandleValue vp, JSBool strict) + MutableHandleValue vp, bool strict) { if (!IsBinaryStruct(obj)) { char *valueStr = JS_EncodeString(cx, JS_ValueToString(cx, ObjectValue(*obj))); @@ -1992,10 +1992,10 @@ BinaryStruct::obj_setGeneric(JSContext *cx, HandleObject obj, HandleId id, return true; } -JSBool +bool BinaryStruct::obj_setProperty(JSContext *cx, HandleObject obj, HandlePropertyName name, MutableHandleValue vp, - JSBool strict) + bool strict) { RootedId id(cx, NON_INTEGER_ATOM_TO_JSID(&(*name))); return obj_setGeneric(cx, obj, id, vp, strict); diff --git a/js/src/builtin/BinaryData.h b/js/src/builtin/BinaryData.h index 21d472e7633e2..e1d0d43982645 100644 --- a/js/src/builtin/BinaryData.h +++ b/js/src/builtin/BinaryData.h @@ -168,86 +168,86 @@ class BinaryArray static bool subarray(JSContext *cx, unsigned int argc, jsval *vp); static bool fill(JSContext *cx, unsigned int argc, jsval *vp); - static JSBool obj_lookupGeneric(JSContext *cx, HandleObject obj, - HandleId id, MutableHandleObject objp, - MutableHandleShape propp); - - static JSBool obj_lookupProperty(JSContext *cx, HandleObject obj, - HandlePropertyName name, - MutableHandleObject objp, - MutableHandleShape propp); - - static JSBool obj_lookupElement(JSContext *cx, HandleObject obj, - uint32_t index, MutableHandleObject objp, - MutableHandleShape propp); - - static JSBool obj_lookupSpecial(JSContext *cx, HandleObject obj, - HandleSpecialId sid, - MutableHandleObject objp, - MutableHandleShape propp); - - static JSBool obj_getGeneric(JSContext *cx, HandleObject obj, - HandleObject receiver, - HandleId id, - MutableHandleValue vp); - - static JSBool obj_getProperty(JSContext *cx, HandleObject obj, - HandleObject receiver, - HandlePropertyName name, - MutableHandleValue vp); - - static JSBool obj_getElement(JSContext *cx, HandleObject obj, - HandleObject receiver, - uint32_t index, - MutableHandleValue vp); - - static JSBool obj_getElementIfPresent(JSContext *cx, HandleObject obj, - HandleObject receiver, - uint32_t index, - MutableHandleValue vp, - bool *present); - - static JSBool obj_getSpecial(JSContext *cx, HandleObject obj, - HandleObject receiver, - HandleSpecialId sid, - MutableHandleValue vp); - - static JSBool obj_setGeneric(JSContext *cx, HandleObject obj, - HandleId id, MutableHandleValue vp, - JSBool strict); - - static JSBool obj_setProperty(JSContext *cx, HandleObject obj, - HandlePropertyName name, - MutableHandleValue vp, - JSBool strict); - - static JSBool obj_setElement(JSContext *cx, HandleObject obj, - uint32_t index, MutableHandleValue vp, - JSBool strict); - - static JSBool obj_setSpecial(JSContext *cx, HandleObject obj, - HandleSpecialId sid, - MutableHandleValue vp, - JSBool strict); - - static JSBool obj_getGenericAttributes(JSContext *cx, HandleObject obj, - HandleId id, unsigned *attrsp); - - static JSBool obj_getPropertyAttributes(JSContext *cx, HandleObject obj, - HandlePropertyName name, - unsigned *attrsp); - - static JSBool obj_getElementAttributes(JSContext *cx, HandleObject obj, - uint32_t index, unsigned *attrsp); - - static JSBool obj_getSpecialAttributes(JSContext *cx, HandleObject obj, - HandleSpecialId sid, - unsigned *attrsp); - - static JSBool obj_enumerate(JSContext *cx, HandleObject obj, - JSIterateOp enum_op, - MutableHandleValue statep, - MutableHandleId idp); + static bool obj_lookupGeneric(JSContext *cx, HandleObject obj, + HandleId id, MutableHandleObject objp, + MutableHandleShape propp); + + static bool obj_lookupProperty(JSContext *cx, HandleObject obj, + HandlePropertyName name, + MutableHandleObject objp, + MutableHandleShape propp); + + static bool obj_lookupElement(JSContext *cx, HandleObject obj, + uint32_t index, MutableHandleObject objp, + MutableHandleShape propp); + + static bool obj_lookupSpecial(JSContext *cx, HandleObject obj, + HandleSpecialId sid, + MutableHandleObject objp, + MutableHandleShape propp); + + static bool obj_getGeneric(JSContext *cx, HandleObject obj, + HandleObject receiver, + HandleId id, + MutableHandleValue vp); + + static bool obj_getProperty(JSContext *cx, HandleObject obj, + HandleObject receiver, + HandlePropertyName name, + MutableHandleValue vp); + + static bool obj_getElement(JSContext *cx, HandleObject obj, + HandleObject receiver, + uint32_t index, + MutableHandleValue vp); + + static bool obj_getElementIfPresent(JSContext *cx, HandleObject obj, + HandleObject receiver, + uint32_t index, + MutableHandleValue vp, + bool *present); + + static bool obj_getSpecial(JSContext *cx, HandleObject obj, + HandleObject receiver, + HandleSpecialId sid, + MutableHandleValue vp); + + static bool obj_setGeneric(JSContext *cx, HandleObject obj, + HandleId id, MutableHandleValue vp, + bool strict); + + static bool obj_setProperty(JSContext *cx, HandleObject obj, + HandlePropertyName name, + MutableHandleValue vp, + bool strict); + + static bool obj_setElement(JSContext *cx, HandleObject obj, + uint32_t index, MutableHandleValue vp, + bool strict); + + static bool obj_setSpecial(JSContext *cx, HandleObject obj, + HandleSpecialId sid, + MutableHandleValue vp, + bool strict); + + static bool obj_getGenericAttributes(JSContext *cx, HandleObject obj, + HandleId id, unsigned *attrsp); + + static bool obj_getPropertyAttributes(JSContext *cx, HandleObject obj, + HandlePropertyName name, + unsigned *attrsp); + + static bool obj_getElementAttributes(JSContext *cx, HandleObject obj, + uint32_t index, unsigned *attrsp); + + static bool obj_getSpecialAttributes(JSContext *cx, HandleObject obj, + HandleSpecialId sid, + unsigned *attrsp); + + static bool obj_enumerate(JSContext *cx, HandleObject obj, + JSIterateOp enum_op, + MutableHandleValue statep, + MutableHandleId idp); static bool lengthGetter(JSContext *cx, unsigned int argc, jsval *vp); }; @@ -296,32 +296,31 @@ class BinaryStruct : public JSObject static void finalize(js::FreeOp *op, JSObject *obj); static void obj_trace(JSTracer *tracer, JSObject *obj); - static JSBool obj_enumerate(JSContext *cx, HandleObject obj, - JSIterateOp enum_op, - MutableHandleValue statep, - MutableHandleId idp); + static bool obj_enumerate(JSContext *cx, HandleObject obj, + JSIterateOp enum_op, + MutableHandleValue statep, + MutableHandleId idp); - static JSBool obj_getGeneric(JSContext *cx, HandleObject obj, - HandleObject receiver, HandleId id, - MutableHandleValue vp); + static bool obj_getGeneric(JSContext *cx, HandleObject obj, + HandleObject receiver, HandleId id, + MutableHandleValue vp); - static JSBool obj_getProperty(JSContext *cx, HandleObject obj, - HandleObject receiver, - HandlePropertyName name, - MutableHandleValue vp); + static bool obj_getProperty(JSContext *cx, HandleObject obj, + HandleObject receiver, + HandlePropertyName name, + MutableHandleValue vp); - static JSBool obj_getSpecial(JSContext *cx, HandleObject obj, - HandleObject receiver, HandleSpecialId sid, - MutableHandleValue vp); + static bool obj_getSpecial(JSContext *cx, HandleObject obj, + HandleObject receiver, HandleSpecialId sid, + MutableHandleValue vp); - static JSBool obj_setGeneric(JSContext *cx, HandleObject obj, HandleId id, - MutableHandleValue vp, JSBool strict); - - static JSBool obj_setProperty(JSContext *cx, HandleObject obj, - HandlePropertyName name, - MutableHandleValue vp, - JSBool strict); + static bool obj_setGeneric(JSContext *cx, HandleObject obj, HandleId id, + MutableHandleValue vp, bool strict); + static bool obj_setProperty(JSContext *cx, HandleObject obj, + HandlePropertyName name, + MutableHandleValue vp, + bool strict); }; } // namespace js diff --git a/js/src/builtin/Object.cpp b/js/src/builtin/Object.cpp index 8dd8eb5db57dd..4809095530aa9 100644 --- a/js/src/builtin/Object.cpp +++ b/js/src/builtin/Object.cpp @@ -388,7 +388,7 @@ DefineAccessor(JSContext *cx, unsigned argc, Value *vp) RootedObject thisObj(cx, &args.thisv().toObject()); - JSBool dummy; + bool dummy; RootedValue descObjValue(cx, ObjectValue(*descObj)); if (!DefineOwnProperty(cx, thisObj, id, descObjValue, &dummy)) return false; @@ -524,7 +524,7 @@ obj_getPrototypeOf(JSContext *cx, unsigned argc, Value *vp) #if JS_HAS_OBJ_WATCHPOINT -static JSBool +static bool obj_watch_handler(JSContext *cx, JSObject *obj_, jsid id_, jsval old, jsval *nvp, void *closure) { @@ -839,7 +839,7 @@ obj_defineProperty(JSContext *cx, unsigned argc, Value *vp) if (!ValueToId(cx, args.get(1), &id)) return false; - JSBool junk; + bool junk; if (!DefineOwnProperty(cx, obj, id, args.get(2), &junk)) return false; diff --git a/js/src/builtin/Profilers.cpp b/js/src/builtin/Profilers.cpp index c3833e5f9eb65..06e7870857833 100644 --- a/js/src/builtin/Profilers.cpp +++ b/js/src/builtin/Profilers.cpp @@ -74,10 +74,10 @@ StartOSXProfiling(const char *profileName = NULL) } #endif -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_StartProfiling(const char *profileName) { - JSBool ok = true; + bool ok = true; #ifdef __APPLE__ ok = StartOSXProfiling(profileName); #endif @@ -88,10 +88,10 @@ JS_StartProfiling(const char *profileName) return ok; } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_StopProfiling(const char *profileName) { - JSBool ok = true; + bool ok = true; #ifdef __APPLE__ #ifdef MOZ_SHARK Shark::Stop(); @@ -111,10 +111,10 @@ JS_StopProfiling(const char *profileName) * Start or stop whatever platform- and configuration-specific profiling * backends are available. */ -static JSBool +static bool ControlProfilers(bool toState) { - JSBool ok = true; + bool ok = true; if (! Probes::ProfilingActive && toState) { #ifdef __APPLE__ @@ -169,22 +169,22 @@ ControlProfilers(bool toState) * profilers' pause/resume functions, because only overall state is * tracked, not the state of each profiler. */ -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_PauseProfilers(const char *profileName) { return ControlProfilers(false); } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_ResumeProfilers(const char *profileName) { return ControlProfilers(true); } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_DumpProfile(const char *outfile, const char *profileName) { - JSBool ok = true; + bool ok = true; #ifdef MOZ_CALLGRIND js_DumpCallgrind(outfile); #endif @@ -378,7 +378,7 @@ static const JSFunctionSpec profiling_functions[] = { #endif -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_DefineProfilingFunctions(JSContext *cx, JSObject *objArg) { RootedObject obj(cx, objArg); @@ -393,7 +393,7 @@ JS_DefineProfilingFunctions(JSContext *cx, JSObject *objArg) #ifdef MOZ_CALLGRIND -JS_FRIEND_API(JSBool) +JS_FRIEND_API(bool) js_StartCallgrind() { JS_SILENCE_UNUSED_VALUE_IN_EXPR(CALLGRIND_START_INSTRUMENTATION); @@ -401,14 +401,14 @@ js_StartCallgrind() return true; } -JS_FRIEND_API(JSBool) +JS_FRIEND_API(bool) js_StopCallgrind() { JS_SILENCE_UNUSED_VALUE_IN_EXPR(CALLGRIND_STOP_INSTRUMENTATION); return true; } -JS_FRIEND_API(JSBool) +JS_FRIEND_API(bool) js_DumpCallgrind(const char *outfile) { if (outfile) { @@ -452,7 +452,7 @@ js_DumpCallgrind(const char *outfile) static bool perfInitialized = false; static pid_t perfPid = 0; -JSBool js_StartPerf() +bool js_StartPerf() { const char *outfile = "mozperf.data"; @@ -528,7 +528,7 @@ JSBool js_StartPerf() } } -JSBool js_StopPerf() +bool js_StopPerf() { if (perfPid == 0) { UnsafeError("js_StopPerf: perf is not running.\n"); diff --git a/js/src/builtin/Profilers.h b/js/src/builtin/Profilers.h index 14caa51effc5f..37aad52cecc62 100644 --- a/js/src/builtin/Profilers.h +++ b/js/src/builtin/Profilers.h @@ -24,21 +24,21 @@ * * Returns true if no profilers fail to start. */ -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_StartProfiling(const char *profileName); /** * Stop any profilers that were previously started with JS_StartProfiling. * Returns true if no profilers fail to stop. */ -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_StopProfiling(const char *profileName); /** * Write the current profile data to the given file, if applicable to whatever * profiler is being used. */ -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_DumpProfile(const char *outfile, const char *profileName); /** @@ -46,13 +46,13 @@ JS_DumpProfile(const char *outfile, const char *profileName); * whether any profilers failed to pause. (Profilers that do not support * pause/resume do not count.) */ -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_PauseProfilers(const char *profileName); /** * Resume suspended profilers */ -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_ResumeProfilers(const char *profileName); /** @@ -65,23 +65,23 @@ JS_UnsafeGetLastProfilingError(); #ifdef MOZ_CALLGRIND -extern JS_FRIEND_API(JSBool) +extern JS_FRIEND_API(bool) js_StopCallgrind(); -extern JS_FRIEND_API(JSBool) +extern JS_FRIEND_API(bool) js_StartCallgrind(); -extern JS_FRIEND_API(JSBool) +extern JS_FRIEND_API(bool) js_DumpCallgrind(const char *outfile); #endif /* MOZ_CALLGRIND */ #ifdef __linux__ -extern JS_FRIEND_API(JSBool) +extern JS_FRIEND_API(bool) js_StartPerf(); -extern JS_FRIEND_API(JSBool) +extern JS_FRIEND_API(bool) js_StopPerf(); #endif /* __linux__ */ diff --git a/js/src/builtin/RegExp.cpp b/js/src/builtin/RegExp.cpp index 3633cddc79382..1ead8ef475cc7 100644 --- a/js/src/builtin/RegExp.cpp +++ b/js/src/builtin/RegExp.cpp @@ -394,7 +394,7 @@ static const JSFunctionSpec regexp_methods[] = { */ #define DEFINE_STATIC_GETTER(name, code) \ - static JSBool \ + static bool \ name(JSContext *cx, HandleObject obj, HandleId id, MutableHandleValue vp) \ { \ RegExpStatics *res = cx->regExpStatics(); \ @@ -420,8 +420,8 @@ DEFINE_STATIC_GETTER(static_paren8_getter, return res->createParen(cx, 8, DEFINE_STATIC_GETTER(static_paren9_getter, return res->createParen(cx, 9, vp)) #define DEFINE_STATIC_SETTER(name, code) \ - static JSBool \ - name(JSContext *cx, HandleObject obj, HandleId id, JSBool strict, MutableHandleValue vp)\ + static bool \ + name(JSContext *cx, HandleObject obj, HandleId id, bool strict, MutableHandleValue vp)\ { \ RegExpStatics *res = cx->regExpStatics(); \ code; \ diff --git a/js/src/builtin/TestingFunctions.cpp b/js/src/builtin/TestingFunctions.cpp index 05ef0a03a054c..3da907447e8a7 100644 --- a/js/src/builtin/TestingFunctions.cpp +++ b/js/src/builtin/TestingFunctions.cpp @@ -199,7 +199,7 @@ GC(JSContext *cx, unsigned argc, jsval *vp) * object, we collect the object's compartment (and any other compartments * scheduled for GC). Otherwise, we collect all compartments. */ - JSBool compartment = false; + bool compartment = false; if (argc == 1) { Value arg = vp[2]; if (arg.isString()) { diff --git a/js/src/ctypes/CTypes.cpp b/js/src/ctypes/CTypes.cpp index e3dda276ec6db..d87437492116e 100644 --- a/js/src/ctypes/CTypes.cpp +++ b/js/src/ctypes/CTypes.cpp @@ -159,23 +159,23 @@ static bool ConstructAbstract(JSContext* cx, unsigned argc, jsval* vp); namespace CType { static bool ConstructData(JSContext* cx, unsigned argc, jsval* vp); - static JSBool ConstructBasic(JSContext* cx, HandleObject obj, const CallArgs& args); + static bool ConstructBasic(JSContext* cx, HandleObject obj, const CallArgs& args); static void Trace(JSTracer* trc, JSObject* obj); static void Finalize(JSFreeOp *fop, JSObject* obj); static void FinalizeProtoClass(JSFreeOp *fop, JSObject* obj); - static JSBool PrototypeGetter(JSContext* cx, HandleObject obj, HandleId idval, + static bool PrototypeGetter(JSContext* cx, HandleObject obj, HandleId idval, MutableHandleValue vp); - static JSBool NameGetter(JSContext* cx, HandleObject obj, HandleId idval, + static bool NameGetter(JSContext* cx, HandleObject obj, HandleId idval, MutableHandleValue vp); - static JSBool SizeGetter(JSContext* cx, HandleObject obj, HandleId idval, + static bool SizeGetter(JSContext* cx, HandleObject obj, HandleId idval, MutableHandleValue vp); - static JSBool PtrGetter(JSContext* cx, HandleObject obj, HandleId idval, MutableHandleValue vp); + static bool PtrGetter(JSContext* cx, HandleObject obj, HandleId idval, MutableHandleValue vp); static bool CreateArray(JSContext* cx, unsigned argc, jsval* vp); static bool ToString(JSContext* cx, unsigned argc, jsval* vp); static bool ToSource(JSContext* cx, unsigned argc, jsval* vp); - static JSBool HasInstance(JSContext* cx, HandleObject obj, MutableHandleValue v, JSBool* bp); + static bool HasInstance(JSContext* cx, HandleObject obj, MutableHandleValue v, bool* bp); /* @@ -196,44 +196,44 @@ namespace ABI { namespace PointerType { static bool Create(JSContext* cx, unsigned argc, jsval* vp); - static JSBool ConstructData(JSContext* cx, HandleObject obj, const CallArgs& args); + static bool ConstructData(JSContext* cx, HandleObject obj, const CallArgs& args); - static JSBool TargetTypeGetter(JSContext* cx, HandleObject obj, HandleId idval, + static bool TargetTypeGetter(JSContext* cx, HandleObject obj, HandleId idval, MutableHandleValue vp); - static JSBool ContentsGetter(JSContext* cx, HandleObject obj, HandleId idval, + static bool ContentsGetter(JSContext* cx, HandleObject obj, HandleId idval, MutableHandleValue vp); - static JSBool ContentsSetter(JSContext* cx, HandleObject obj, HandleId idval, JSBool strict, + static bool ContentsSetter(JSContext* cx, HandleObject obj, HandleId idval, bool strict, MutableHandleValue vp); static bool IsNull(JSContext* cx, unsigned argc, jsval* vp); static bool Increment(JSContext* cx, unsigned argc, jsval* vp); static bool Decrement(JSContext* cx, unsigned argc, jsval* vp); // The following is not an instance function, since we don't want to expose arbitrary // pointer arithmetic at this moment. - static JSBool OffsetBy(JSContext* cx, const CallArgs& args, int offset); + static bool OffsetBy(JSContext* cx, const CallArgs& args, int offset); } namespace ArrayType { static bool Create(JSContext* cx, unsigned argc, jsval* vp); - static JSBool ConstructData(JSContext* cx, HandleObject obj, const CallArgs& args); + static bool ConstructData(JSContext* cx, HandleObject obj, const CallArgs& args); - static JSBool ElementTypeGetter(JSContext* cx, HandleObject obj, HandleId idval, + static bool ElementTypeGetter(JSContext* cx, HandleObject obj, HandleId idval, MutableHandleValue vp); - static JSBool LengthGetter(JSContext* cx, HandleObject obj, HandleId idval, + static bool LengthGetter(JSContext* cx, HandleObject obj, HandleId idval, MutableHandleValue vp); - static JSBool Getter(JSContext* cx, HandleObject obj, HandleId idval, MutableHandleValue vp); - static JSBool Setter(JSContext* cx, HandleObject obj, HandleId idval, JSBool strict, MutableHandleValue vp); + static bool Getter(JSContext* cx, HandleObject obj, HandleId idval, MutableHandleValue vp); + static bool Setter(JSContext* cx, HandleObject obj, HandleId idval, bool strict, MutableHandleValue vp); static bool AddressOfElement(JSContext* cx, unsigned argc, jsval* vp); } namespace StructType { static bool Create(JSContext* cx, unsigned argc, jsval* vp); - static JSBool ConstructData(JSContext* cx, HandleObject obj, const CallArgs& args); + static bool ConstructData(JSContext* cx, HandleObject obj, const CallArgs& args); - static JSBool FieldsArrayGetter(JSContext* cx, HandleObject obj, HandleId idval, + static bool FieldsArrayGetter(JSContext* cx, HandleObject obj, HandleId idval, MutableHandleValue vp); - static JSBool FieldGetter(JSContext* cx, HandleObject obj, HandleId idval, + static bool FieldGetter(JSContext* cx, HandleObject obj, HandleId idval, MutableHandleValue vp); - static JSBool FieldSetter(JSContext* cx, HandleObject obj, HandleId idval, JSBool strict, + static bool FieldSetter(JSContext* cx, HandleObject obj, HandleId idval, bool strict, MutableHandleValue vp); static bool AddressOfField(JSContext* cx, unsigned argc, jsval* vp); static bool Define(JSContext* cx, unsigned argc, jsval* vp); @@ -241,17 +241,17 @@ namespace StructType { namespace FunctionType { static bool Create(JSContext* cx, unsigned argc, jsval* vp); - static JSBool ConstructData(JSContext* cx, HandleObject typeObj, + static bool ConstructData(JSContext* cx, HandleObject typeObj, HandleObject dataObj, HandleObject fnObj, HandleObject thisObj, jsval errVal); static bool Call(JSContext* cx, unsigned argc, jsval* vp); - static JSBool ArgTypesGetter(JSContext* cx, HandleObject obj, HandleId idval, + static bool ArgTypesGetter(JSContext* cx, HandleObject obj, HandleId idval, MutableHandleValue vp); - static JSBool ReturnTypeGetter(JSContext* cx, HandleObject obj, HandleId idval, + static bool ReturnTypeGetter(JSContext* cx, HandleObject obj, HandleId idval, MutableHandleValue vp); - static JSBool ABIGetter(JSContext* cx, HandleObject obj, HandleId idval, MutableHandleValue vp); - static JSBool IsVariadicGetter(JSContext* cx, HandleObject obj, HandleId idval, + static bool ABIGetter(JSContext* cx, HandleObject obj, HandleId idval, MutableHandleValue vp); + static bool IsVariadicGetter(JSContext* cx, HandleObject obj, HandleId idval, MutableHandleValue vp); } @@ -267,22 +267,22 @@ namespace CClosure { namespace CData { static void Finalize(JSFreeOp *fop, JSObject* obj); - static JSBool ValueGetter(JSContext* cx, HandleObject obj, HandleId idval, - MutableHandleValue vp); - static JSBool ValueSetter(JSContext* cx, HandleObject obj, HandleId idval, - JSBool strict, MutableHandleValue vp); + static bool ValueGetter(JSContext* cx, HandleObject obj, HandleId idval, + MutableHandleValue vp); + static bool ValueSetter(JSContext* cx, HandleObject obj, HandleId idval, + bool strict, MutableHandleValue vp); static bool Address(JSContext* cx, unsigned argc, jsval* vp); static bool ReadString(JSContext* cx, unsigned argc, jsval* vp); static bool ReadStringReplaceMalformed(JSContext* cx, unsigned argc, jsval* vp); static bool ToSource(JSContext* cx, unsigned argc, jsval* vp); static JSString *GetSourceString(JSContext *cx, HandleObject typeObj, void *data); - static JSBool ErrnoGetter(JSContext* cx, HandleObject obj, HandleId idval, - MutableHandleValue vp); + static bool ErrnoGetter(JSContext* cx, HandleObject obj, HandleId idval, + MutableHandleValue vp); #if defined(XP_WIN) - static JSBool LastErrorGetter(JSContext* cx, HandleObject obj, HandleId idval, - MutableHandleValue vp); + static bool LastErrorGetter(JSContext* cx, HandleObject obj, HandleId idval, + MutableHandleValue vp); #endif // defined(XP_WIN) } @@ -802,7 +802,7 @@ GetErrorMessage(void* userRef, const char* locale, const unsigned errorNumber) return NULL; } -static JSBool +static bool TypeError(JSContext* cx, const char* expected, jsval actual) { JSString* str = JS_ValueToSource(cx, actual); @@ -918,7 +918,7 @@ InitCDataClass(JSContext* cx, HandleObject parent, HandleObject CTypeProto) return prototype; } -static JSBool +static bool DefineABIConstant(JSContext* cx, HandleObject parent, const char* name, @@ -935,7 +935,7 @@ DefineABIConstant(JSContext* cx, // Set up a single type constructor for // ctypes.{Pointer,Array,Struct,Function}Type. -static JSBool +static bool InitTypeConstructor(JSContext* cx, HandleObject parent, HandleObject CTypeProto, @@ -1057,7 +1057,7 @@ AttachProtos(JSObject* proto, const AutoObjectVector& protos) JS_SetReservedSlot(proto, i, OBJECT_TO_JSVAL(protos[i])); } -static JSBool +static bool InitTypeClasses(JSContext* cx, HandleObject parent) { // Initialize the ctypes.CType class. This acts as an abstract base class for @@ -1276,7 +1276,7 @@ static bool GetObjectProperty(JSContext *cx, HandleObject obj, using namespace js; using namespace js::ctypes; -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_InitCTypesClass(JSContext* cx, JSObject *globalArg) { RootedObject global(cx, globalArg); @@ -1346,7 +1346,7 @@ SizeOfDataIfCDataObject(mozilla::MallocSizeOf mallocSizeOf, JSObject *obj) size_t n = 0; jsval slot = JS_GetReservedSlot(obj, ctypes::SLOT_OWNS); if (!JSVAL_IS_VOID(slot)) { - JSBool owns = JSVAL_TO_BOOLEAN(slot); + bool owns = JSVAL_TO_BOOLEAN(slot); slot = JS_GetReservedSlot(obj, ctypes::SLOT_DATA); if (!JSVAL_IS_VOID(slot)) { char** buffer = static_cast(JSVAL_TO_PRIVATE(slot)); @@ -1531,7 +1531,7 @@ static JS_ALWAYS_INLINE bool IsNegative(Type i) return IsNegativeImpl::is_signed>::Test(i); } -// Implicitly convert val to bool, allowing JSBool, int, and double +// Implicitly convert val to bool, allowing bool, int, and double // arguments numerically equal to 0 or 1. static bool jsvalToBool(JSContext* cx, jsval val, bool* result) @@ -1555,7 +1555,7 @@ jsvalToBool(JSContext* cx, jsval val, bool* result) return false; } -// Implicitly convert val to IntegerType, allowing JSBool, int, double, +// Implicitly convert val to IntegerType, allowing bool, int, double, // Int64, UInt64, and CData integer types 't' where all values of 't' are // representable by IntegerType. template @@ -1886,7 +1886,7 @@ jsidToSize(JSContext* cx, jsid val, bool allowString, size_t* result) // Implicitly convert a size value to a jsval, ensuring that the size_t value // fits in a double. -static JSBool +static bool SizeTojsval(JSContext* cx, size_t size, jsval* result) { if (Convert(double(size)) != size) { @@ -2032,7 +2032,7 @@ strnlen(const CharType* begin, size_t max) // parent's buffer. // * If 'parentObj' is null, the new CData object may or may not own its // resulting buffer depending on the 'ownResult' argument. -static JSBool +static bool ConvertToJS(JSContext* cx, HandleObject typeObj, HandleObject parentObj, @@ -2187,7 +2187,7 @@ bool CanConvertTypedArrayItemTo(JSObject *baseType, JSObject *valObj, JSContext // we can autoconvert a JS string primitive to a pointer-to-character type. // In this case, ownership of the allocated string is handed off to the // caller; 'freePointer' will be set to indicate this. -static JSBool +static bool ImplicitConvert(JSContext* cx, HandleValue val, JSObject* targetType_, @@ -2578,7 +2578,7 @@ ImplicitConvert(JSContext* cx, // Convert jsval 'val' to a C binary representation of CType 'targetType', // storing the result in 'buffer'. This function is more forceful than // ImplicitConvert. -static JSBool +static bool ExplicitConvert(JSContext* cx, HandleValue val, HandleObject targetType, void* buffer) { // If ImplicitConvert succeeds, use that result. @@ -2601,7 +2601,7 @@ ExplicitConvert(JSContext* cx, HandleValue val, HandleObject targetType, void* b switch (type) { case TYPE_bool: { // Convert according to the ECMAScript ToBoolean() function. - JSBool result; + bool result; ASSERT_OK(JS_ValueToBoolean(cx, val, &result)); *static_cast(buffer) = result != false; break; @@ -2910,7 +2910,7 @@ BuildTypeSource(JSContext* cx, // resulting string can ImplicitConvert successfully if passed to another data // constructor. (This is important when called recursively, since fields of // structs and arrays are converted with ImplicitConvert.) -static JSBool +static bool BuildDataSource(JSContext* cx, HandleObject typeObj, void* data, @@ -3116,7 +3116,7 @@ CType::ConstructData(JSContext* cx, } } -JSBool +bool CType::ConstructBasic(JSContext* cx, HandleObject obj, const CallArgs& args) @@ -3591,7 +3591,7 @@ CType::GetProtoFromType(JSContext* cx, JSObject* objArg, CTypeProtoSlot slot) return JSVAL_TO_OBJECT(result); } -JSBool +bool CType::PrototypeGetter(JSContext* cx, HandleObject obj, HandleId idval, MutableHandleValue vp) { if (!(CType::IsCType(obj) || CType::IsCTypeProto(obj))) { @@ -3606,7 +3606,7 @@ CType::PrototypeGetter(JSContext* cx, HandleObject obj, HandleId idval, MutableH return true; } -JSBool +bool CType::NameGetter(JSContext* cx, HandleObject obj, HandleId idval, MutableHandleValue vp) { if (!CType::IsCType(obj)) { @@ -3622,7 +3622,7 @@ CType::NameGetter(JSContext* cx, HandleObject obj, HandleId idval, MutableHandle return true; } -JSBool +bool CType::SizeGetter(JSContext* cx, HandleObject obj, HandleId idval, MutableHandleValue vp) { if (!CType::IsCType(obj)) { @@ -3635,7 +3635,7 @@ CType::SizeGetter(JSContext* cx, HandleObject obj, HandleId idval, MutableHandle return true; } -JSBool +bool CType::PtrGetter(JSContext* cx, HandleObject obj, HandleId idval, MutableHandleValue vp) { if (!CType::IsCType(obj)) { @@ -3745,8 +3745,8 @@ CType::ToSource(JSContext* cx, unsigned argc, jsval* vp) return true; } -JSBool -CType::HasInstance(JSContext* cx, HandleObject obj, MutableHandleValue v, JSBool* bp) +bool +CType::HasInstance(JSContext* cx, HandleObject obj, MutableHandleValue v, bool* bp) { JS_ASSERT(CType::IsCType(obj)); @@ -3907,7 +3907,7 @@ PointerType::CreateInternal(JSContext* cx, HandleObject baseType) return typeObj; } -JSBool +bool PointerType::ConstructData(JSContext* cx, HandleObject obj, const CallArgs& args) @@ -3999,7 +3999,7 @@ PointerType::GetBaseType(JSObject* obj) return &type.toObject(); } -JSBool +bool PointerType::TargetTypeGetter(JSContext* cx, HandleObject obj, HandleId idval, @@ -4039,7 +4039,7 @@ PointerType::IsNull(JSContext* cx, unsigned argc, jsval* vp) return true; } -JSBool +bool PointerType::OffsetBy(JSContext* cx, const CallArgs& args, int offset) { JSObject* obj = JS_THIS_OBJECT(cx, args.base()); @@ -4089,7 +4089,7 @@ PointerType::Decrement(JSContext* cx, unsigned argc, jsval* vp) return OffsetBy(cx, args, -1); } -JSBool +bool PointerType::ContentsGetter(JSContext* cx, HandleObject obj, HandleId idval, @@ -4127,11 +4127,11 @@ PointerType::ContentsGetter(JSContext* cx, return true; } -JSBool +bool PointerType::ContentsSetter(JSContext* cx, HandleObject obj, HandleId idval, - JSBool strict, + bool strict, MutableHandleValue vp) { if (!CData::IsCData(obj)) { @@ -4252,7 +4252,7 @@ ArrayType::CreateInternal(JSContext* cx, return typeObj; } -JSBool +bool ArrayType::ConstructData(JSContext* cx, HandleObject obj_, const CallArgs& args) @@ -4448,7 +4448,7 @@ ArrayType::BuildFFIType(JSContext* cx, JSObject* obj) return ffiType.forget(); } -JSBool +bool ArrayType::ElementTypeGetter(JSContext* cx, HandleObject obj, HandleId idval, MutableHandleValue vp) { if (!CType::IsCType(obj) || CType::GetTypeCode(obj) != TYPE_array) { @@ -4461,7 +4461,7 @@ ArrayType::ElementTypeGetter(JSContext* cx, HandleObject obj, HandleId idval, Mu return true; } -JSBool +bool ArrayType::LengthGetter(JSContext* cx, HandleObject obj_, HandleId idval, MutableHandleValue vp) { JSObject *obj = obj_; @@ -4481,7 +4481,7 @@ ArrayType::LengthGetter(JSContext* cx, HandleObject obj_, HandleId idval, Mutabl return true; } -JSBool +bool ArrayType::Getter(JSContext* cx, HandleObject obj, HandleId idval, MutableHandleValue vp) { // This should never happen, but we'll check to be safe. @@ -4517,8 +4517,8 @@ ArrayType::Getter(JSContext* cx, HandleObject obj, HandleId idval, MutableHandle return ConvertToJS(cx, baseType, obj, data, false, false, vp.address()); } -JSBool -ArrayType::Setter(JSContext* cx, HandleObject obj, HandleId idval, JSBool strict, MutableHandleValue vp) +bool +ArrayType::Setter(JSContext* cx, HandleObject obj, HandleId idval, bool strict, MutableHandleValue vp) { // This should never happen, but we'll check to be safe. if (!CData::IsCData(obj)) { @@ -4669,7 +4669,7 @@ ExtractStructField(JSContext* cx, jsval val, JSObject** typeObj) // For a struct field with 'name' and 'type', add an element of the form // { name : type }. -static JSBool +static bool AddFieldToArray(JSContext* cx, jsval* element, JSFlatString* name_, @@ -4746,7 +4746,7 @@ PostBarrierCallback(JSTracer *trc, void *k, void *d) table->rekey(JS_ASSERT_STRING_IS_FLAT(prior), JS_ASSERT_STRING_IS_FLAT(key)); } -JSBool +bool StructType::DefineInternal(JSContext* cx, JSObject* typeObj_, JSObject* fieldsObj_) { RootedObject typeObj(cx, typeObj_); @@ -4988,7 +4988,7 @@ StructType::Define(JSContext* cx, unsigned argc, jsval* vp) return DefineInternal(cx, obj, arr); } -JSBool +bool StructType::ConstructData(JSContext* cx, HandleObject obj, const CallArgs& args) @@ -5128,7 +5128,7 @@ StructType::BuildFieldsArray(JSContext* cx, JSObject* obj) return fieldsProp; } -JSBool +bool StructType::FieldsArrayGetter(JSContext* cx, HandleObject obj, HandleId idval, MutableHandleValue vp) { if (!CType::IsCType(obj) || CType::GetTypeCode(obj) != TYPE_struct) { @@ -5158,7 +5158,7 @@ StructType::FieldsArrayGetter(JSContext* cx, HandleObject obj, HandleId idval, M return true; } -JSBool +bool StructType::FieldGetter(JSContext* cx, HandleObject obj, HandleId idval, MutableHandleValue vp) { if (!CData::IsCData(obj)) { @@ -5181,8 +5181,8 @@ StructType::FieldGetter(JSContext* cx, HandleObject obj, HandleId idval, Mutable return ConvertToJS(cx, fieldType, obj, data, false, false, vp.address()); } -JSBool -StructType::FieldSetter(JSContext* cx, HandleObject obj, HandleId idval, JSBool strict, MutableHandleValue vp) +bool +StructType::FieldSetter(JSContext* cx, HandleObject obj, HandleId idval, bool strict, MutableHandleValue vp) { if (!CData::IsCData(obj)) { JS_ReportError(cx, "not a CData"); @@ -5377,7 +5377,7 @@ PrepareReturnType(JSContext* cx, jsval type) return result; } -static JS_ALWAYS_INLINE JSBool +static JS_ALWAYS_INLINE bool IsEllipsis(JSContext* cx, jsval v, bool* isEllipsis) { *isEllipsis = false; @@ -5396,7 +5396,7 @@ IsEllipsis(JSContext* cx, jsval v, bool* isEllipsis) return true; } -static JSBool +static bool PrepareCIF(JSContext* cx, FunctionInfo* fninfo) { @@ -5642,7 +5642,7 @@ FunctionType::CreateInternal(JSContext* cx, // Construct a function pointer to a JS function (see CClosure::Create()). // Regular function pointers are constructed directly in // PointerType::ConstructData(). -JSBool +bool FunctionType::ConstructData(JSContext* cx, HandleObject typeObj, HandleObject dataObj, @@ -5683,7 +5683,7 @@ FunctionType::ConstructData(JSContext* cx, typedef Array AutoValueAutoArray; -static JSBool +static bool ConvertArgument(JSContext* cx, HandleValue arg, JSObject* type, @@ -5888,7 +5888,7 @@ FunctionType::GetFunctionInfo(JSObject* obj) return static_cast(JSVAL_TO_PRIVATE(slot)); } -static JSBool +static bool CheckFunctionType(JSContext* cx, JSObject* obj) { if (!CType::IsCType(obj) || CType::GetTypeCode(obj) != TYPE_function) { @@ -5898,7 +5898,7 @@ CheckFunctionType(JSContext* cx, JSObject* obj) return true; } -JSBool +bool FunctionType::ArgTypesGetter(JSContext* cx, HandleObject obj, HandleId idval, MutableHandleValue vp) { if (!CheckFunctionType(cx, obj)) @@ -5933,7 +5933,7 @@ FunctionType::ArgTypesGetter(JSContext* cx, HandleObject obj, HandleId idval, Mu return true; } -JSBool +bool FunctionType::ReturnTypeGetter(JSContext* cx, HandleObject obj, HandleId idval, MutableHandleValue vp) { if (!CheckFunctionType(cx, obj)) @@ -5944,7 +5944,7 @@ FunctionType::ReturnTypeGetter(JSContext* cx, HandleObject obj, HandleId idval, return true; } -JSBool +bool FunctionType::ABIGetter(JSContext* cx, HandleObject obj, HandleId idval, MutableHandleValue vp) { if (!CheckFunctionType(cx, obj)) @@ -5955,7 +5955,7 @@ FunctionType::ABIGetter(JSContext* cx, HandleObject obj, HandleId idval, Mutable return true; } -JSBool +bool FunctionType::IsVariadicGetter(JSContext* cx, HandleObject obj, HandleId idval, MutableHandleValue vp) { if (!CheckFunctionType(cx, obj)) @@ -6186,7 +6186,7 @@ CClosure::ClosureStub(ffi_cif* cif, void* result, void** args, void* userData) // Call the JS function. 'thisObj' may be NULL, in which case the JS engine // will find an appropriate object to use. RootedValue rval(cx); - JSBool success = JS_CallFunctionValue(cx, thisObj, OBJECT_TO_JSVAL(jsfnObj), + bool success = JS_CallFunctionValue(cx, thisObj, OBJECT_TO_JSVAL(jsfnObj), cif->nargs, argv.begin(), rval.address()); // Convert the result. Note that we pass 'isArgument = false', such that @@ -6354,7 +6354,7 @@ CData::Finalize(JSFreeOp *fop, JSObject* obj) if (JSVAL_IS_VOID(slot)) return; - JSBool owns = JSVAL_TO_BOOLEAN(slot); + bool owns = JSVAL_TO_BOOLEAN(slot); slot = JS_GetReservedSlot(obj, SLOT_DATA); if (JSVAL_IS_VOID(slot)) @@ -6402,7 +6402,7 @@ CData::IsCDataProto(JSObject* obj) return JS_GetClass(obj) == &sCDataProtoClass; } -JSBool +bool CData::ValueGetter(JSContext* cx, HandleObject obj, HandleId idval, MutableHandleValue vp) { if (!IsCData(obj)) { @@ -6418,8 +6418,8 @@ CData::ValueGetter(JSContext* cx, HandleObject obj, HandleId idval, MutableHandl return true; } -JSBool -CData::ValueSetter(JSContext* cx, HandleObject obj, HandleId idval, JSBool strict, MutableHandleValue vp) +bool +CData::ValueSetter(JSContext* cx, HandleObject obj, HandleId idval, bool strict, MutableHandleValue vp) { if (!IsCData(obj)) { JS_ReportError(cx, "not a CData"); @@ -6691,7 +6691,7 @@ CData::ToSource(JSContext* cx, unsigned argc, jsval* vp) return true; } -JSBool +bool CData::ErrnoGetter(JSContext* cx, HandleObject obj, HandleId, MutableHandleValue vp) { if (!IsCTypesGlobal(obj)) { @@ -6704,7 +6704,7 @@ CData::ErrnoGetter(JSContext* cx, HandleObject obj, HandleId, MutableHandleValue } #if defined(XP_WIN) -JSBool +bool CData::LastErrorGetter(JSContext* cx, HandleObject obj, HandleId, MutableHandleValue vp) { if (!IsCTypesGlobal(obj)) { diff --git a/js/src/ctypes/CTypes.h b/js/src/ctypes/CTypes.h index 74c9dfab80264..40165206c493b 100644 --- a/js/src/ctypes/CTypes.h +++ b/js/src/ctypes/CTypes.h @@ -169,7 +169,7 @@ DeflateStringToUTF8Buffer(JSContext *maybecx, const jschar *src, size_t srclen, *******************************************************************************/ JS_ALWAYS_INLINE void -ASSERT_OK(JSBool ok) +ASSERT_OK(bool ok) { JS_ASSERT(ok); } @@ -231,7 +231,7 @@ struct FieldHashPolicy return hash; } - static JSBool match(const Key &k, const Lookup &l) { + static bool match(const Key &k, const Lookup &l) { if (k == l) return true; @@ -443,7 +443,7 @@ namespace ArrayType { } namespace StructType { - JSBool DefineInternal(JSContext* cx, JSObject* typeObj, JSObject* fieldsObj); + bool DefineInternal(JSContext* cx, JSObject* typeObj, JSObject* fieldsObj); const FieldInfoHash* GetFieldInfo(JSObject* obj); const FieldInfo* LookupField(JSContext* cx, JSObject* obj, JSFlatString *name); diff --git a/js/src/gdb/gdb-tests.cpp b/js/src/gdb/gdb-tests.cpp index 1158880bab52b..e3ae3685912c5 100644 --- a/js/src/gdb/gdb-tests.cpp +++ b/js/src/gdb/gdb-tests.cpp @@ -28,7 +28,7 @@ checkPtr(T *ptr) } void -checkBool(JSBool success) +checkBool(bool success) { if (! success) abort(); diff --git a/js/src/ion/IonBuilder.cpp b/js/src/ion/IonBuilder.cpp index c2286a8e32c94..0d027f55eaad0 100644 --- a/js/src/ion/IonBuilder.cpp +++ b/js/src/ion/IonBuilder.cpp @@ -5300,7 +5300,7 @@ IonBuilder::jsop_eval(uint32_t argc) { JSString *str = string->getOperand(1)->toConstant()->value().toString(); - JSBool match; + bool match; if (!JS_StringEqualsAscii(cx, str, "()", &match)) return false; if (match) { diff --git a/js/src/ion/IonCaches.cpp b/js/src/ion/IonCaches.cpp index 1a5b977bedf3d..1c1213255e32b 100644 --- a/js/src/ion/IonCaches.cpp +++ b/js/src/ion/IonCaches.cpp @@ -933,7 +933,7 @@ GenerateCallGetter(JSContext *cx, IonScript *ion, MacroAssembler &masm, PropertyOp target = shape->getterOp(); JS_ASSERT(target); - // JSPropertyOp: JSBool fn(JSContext *cx, HandleObject obj, HandleId id, MutableHandleValue vp) + // JSPropertyOp: bool fn(JSContext *cx, HandleObject obj, HandleId id, MutableHandleValue vp) // Push args on stack first so we can take pointers to make handles. masm.Push(UndefinedValue()); @@ -1858,8 +1858,8 @@ SetPropertyIC::attachSetterCall(JSContext *cx, IonScript *ion, StrictPropertyOp target = shape->setterOp(); JS_ASSERT(target); - // JSStrictPropertyOp: JSBool fn(JSContext *cx, HandleObject obj, - // HandleId id, JSBool strict, MutableHandleValue vp); + // JSStrictPropertyOp: bool fn(JSContext *cx, HandleObject obj, + // HandleId id, bool strict, MutableHandleValue vp); // Push args on stack first so we can take pointers to make handles. if (value().constant()) diff --git a/js/src/ion/x64/Trampoline-x64.cpp b/js/src/ion/x64/Trampoline-x64.cpp index facc540f303ee..1192e11c335da 100644 --- a/js/src/ion/x64/Trampoline-x64.cpp +++ b/js/src/ion/x64/Trampoline-x64.cpp @@ -27,7 +27,7 @@ static const RegisterSet AllRegs = /* This method generates a trampoline on x64 for a c++ function with * the following signature: - * JSBool blah(void *code, int argc, Value *argv, JSObject *scopeChain, + * bool blah(void *code, int argc, Value *argv, JSObject *scopeChain, * Value *vp) * ...using standard x64 fastcall calling convention */ diff --git a/js/src/jsapi-tests/README b/js/src/jsapi-tests/README index 24dfb255b8800..44de5579b252e 100644 --- a/js/src/jsapi-tests/README +++ b/js/src/jsapi-tests/README @@ -49,7 +49,7 @@ The BEGIN_TEST and END_TEST macros bracket each test. By convention, the test name is _. (The above test is in testIntString.cpp.) The curly braces are required. This block is the body of a C++ member function -that returns JSBool. The test harness calls this member function +that returns bool. The test harness calls this member function automatically. If the function returns true, the test passes. False, it fails. JSAPI tests often need extra global C/C++ code: a JSClass, a getter or setter diff --git a/js/src/jsapi-tests/testAddPropertyPropcache.cpp b/js/src/jsapi-tests/testAddPropertyPropcache.cpp index b8d229fb1d12f..a2fcb70bb1737 100644 --- a/js/src/jsapi-tests/testAddPropertyPropcache.cpp +++ b/js/src/jsapi-tests/testAddPropertyPropcache.cpp @@ -12,7 +12,7 @@ static const int expectedCount = 100; static int callCount = 0; -static JSBool +static bool addProperty(JSContext *cx, JS::HandleObject obj, JS::HandleId id, JS::MutableHandleValue vp) { callCount++; diff --git a/js/src/jsapi-tests/testChromeBuffer.cpp b/js/src/jsapi-tests/testChromeBuffer.cpp index b68585b57b728..9b33ae8be8a68 100644 --- a/js/src/jsapi-tests/testChromeBuffer.cpp +++ b/js/src/jsapi-tests/testChromeBuffer.cpp @@ -121,7 +121,7 @@ BEGIN_TEST(testChromeBuffer) JS::RootedValue rval(cx); CHECK(JS_CallFunction(cx, NULL, fun, 1, v.address(), rval.address())); - JSBool match; + bool match; CHECK(JS_StringEqualsAscii(cx, JSVAL_TO_STRING(rval), "From trusted: InternalError: too much recursion", &match)); CHECK(match); } diff --git a/js/src/jsapi-tests/testClassGetter.cpp b/js/src/jsapi-tests/testClassGetter.cpp index ef59a7d003ede..03d913092f797 100644 --- a/js/src/jsapi-tests/testClassGetter.cpp +++ b/js/src/jsapi-tests/testClassGetter.cpp @@ -12,7 +12,7 @@ int called_test_fn; int called_test_prop_get; -static JSBool test_prop_get( JSContext *cx, JS::HandleObject obj, JS::HandleId id, JS::MutableHandleValue vp ) +static bool test_prop_get( JSContext *cx, JS::HandleObject obj, JS::HandleId id, JS::MutableHandleValue vp ) { called_test_prop_get++; return true; diff --git a/js/src/jsapi-tests/testContexts.cpp b/js/src/jsapi-tests/testContexts.cpp index a018e5dbb1f7f..4c2f00f18600d 100644 --- a/js/src/jsapi-tests/testContexts.cpp +++ b/js/src/jsapi-tests/testContexts.cpp @@ -36,7 +36,7 @@ BEGIN_TEST(testContexts_bug563735) JSContext *cx2 = JS_NewContext(rt, 8192); CHECK(cx2); - JSBool ok; + bool ok; { JSAutoRequest req(cx2); JSAutoCompartment ac(cx2, global); diff --git a/js/src/jsapi-tests/testCustomIterator.cpp b/js/src/jsapi-tests/testCustomIterator.cpp index 0dd375ae54337..11eda4076720d 100644 --- a/js/src/jsapi-tests/testCustomIterator.cpp +++ b/js/src/jsapi-tests/testCustomIterator.cpp @@ -18,7 +18,7 @@ IterNext(JSContext *cx, unsigned argc, jsval *vp) } static JSObject * -IterHook(JSContext *cx, JS::HandleObject obj, JSBool keysonly) +IterHook(JSContext *cx, JS::HandleObject obj, bool keysonly) { JS::RootedObject iterObj(cx, JS_NewObject(cx, NULL, NULL, NULL)); if (!iterObj) diff --git a/js/src/jsapi-tests/testDebugger.cpp b/js/src/jsapi-tests/testDebugger.cpp index c777950cd5e84..b34b822941ac9 100644 --- a/js/src/jsapi-tests/testDebugger.cpp +++ b/js/src/jsapi-tests/testDebugger.cpp @@ -13,8 +13,8 @@ static int callCount[2] = {0, 0}; static void * -callCountHook(JSContext *cx, JSAbstractFramePtr frame, bool isConstructing, JSBool before, - JSBool *ok, void *closure) +callCountHook(JSContext *cx, JSAbstractFramePtr frame, bool isConstructing, bool before, + bool *ok, void *closure) { callCount[before]++; @@ -39,8 +39,8 @@ BEGIN_TEST(testDebugger_bug519719) END_TEST(testDebugger_bug519719) static void * -nonStrictThisHook(JSContext *cx, JSAbstractFramePtr frame, bool isConstructing, JSBool before, - JSBool *ok, void *closure) +nonStrictThisHook(JSContext *cx, JSAbstractFramePtr frame, bool isConstructing, bool before, + bool *ok, void *closure) { if (before) { bool *allWrapped = (bool *) closure; @@ -78,8 +78,8 @@ BEGIN_TEST(testDebugger_getThisNonStrict) END_TEST(testDebugger_getThisNonStrict) static void * -strictThisHook(JSContext *cx, JSAbstractFramePtr frame, bool isConstructing, JSBool before, - JSBool *ok, void *closure) +strictThisHook(JSContext *cx, JSAbstractFramePtr frame, bool isConstructing, bool before, + bool *ok, void *closure) { if (before) { bool *anyWrapped = (bool *) closure; diff --git a/js/src/jsapi-tests/testDefineGetterSetterNonEnumerable.cpp b/js/src/jsapi-tests/testDefineGetterSetterNonEnumerable.cpp index 60f76b353f9db..5eb03811264e5 100644 --- a/js/src/jsapi-tests/testDefineGetterSetterNonEnumerable.cpp +++ b/js/src/jsapi-tests/testDefineGetterSetterNonEnumerable.cpp @@ -45,7 +45,7 @@ BEGIN_TEST(testDefineGetterSetterNonEnumerable) JS_DATA_TO_FUNC_PTR(JSStrictPropertyOp, (JSObject*) funSetObj), JSPROP_GETTER | JSPROP_SETTER | JSPROP_PERMANENT)); - JSBool found = false; + bool found = false; unsigned attrs = 0; CHECK(JS_GetPropertyAttributes(cx, vObject, PROPERTY_NAME, &attrs, &found)); CHECK(found); diff --git a/js/src/jsapi-tests/testFuncCallback.cpp b/js/src/jsapi-tests/testFuncCallback.cpp index 9d1974b30cfc4..75465f6ccd576 100644 --- a/js/src/jsapi-tests/testFuncCallback.cpp +++ b/js/src/jsapi-tests/testFuncCallback.cpp @@ -30,7 +30,7 @@ funcTransition(const JSFunction *, } } -static JSBool called2 = false; +static bool called2 = false; static void funcTransition2(const JSFunction *, const JSScript*, const JSContext*, int) diff --git a/js/src/jsapi-tests/testGCFinalizeCallback.cpp b/js/src/jsapi-tests/testGCFinalizeCallback.cpp index cd763219d4d15..e796e424b4e8b 100644 --- a/js/src/jsapi-tests/testGCFinalizeCallback.cpp +++ b/js/src/jsapi-tests/testGCFinalizeCallback.cpp @@ -17,7 +17,7 @@ static JSFinalizeStatus StatusBuffer[BufferSize]; static bool IsCompartmentGCBuffer[BufferSize]; static void -FinalizeCallback(JSFreeOp *fop, JSFinalizeStatus status, JSBool isCompartmentGC) +FinalizeCallback(JSFreeOp *fop, JSFinalizeStatus status, bool isCompartmentGC) { if (FinalizeCalls < BufferSize) { StatusBuffer[FinalizeCalls] = status; diff --git a/js/src/jsapi-tests/testGCOutOfMemory.cpp b/js/src/jsapi-tests/testGCOutOfMemory.cpp index d8779a55a62e8..74d4d9cbee2f7 100644 --- a/js/src/jsapi-tests/testGCOutOfMemory.cpp +++ b/js/src/jsapi-tests/testGCOutOfMemory.cpp @@ -31,7 +31,7 @@ BEGIN_TEST(testGCOutOfMemory) " array.push({});" " array = []; array.push(0);" "})();"; - JSBool ok = JS_EvaluateScript(cx, global, source, strlen(source), "", 1, + bool ok = JS_EvaluateScript(cx, global, source, strlen(source), "", 1, root.address()); /* Check that we get OOM. */ diff --git a/js/src/jsapi-tests/testGetPropertyDefault.cpp b/js/src/jsapi-tests/testGetPropertyDefault.cpp index 0d0323cbd9a69..decf72bbf0cfc 100644 --- a/js/src/jsapi-tests/testGetPropertyDefault.cpp +++ b/js/src/jsapi-tests/testGetPropertyDefault.cpp @@ -10,7 +10,7 @@ #define JSVAL_IS_FALSE(x) ((JSVAL_IS_BOOLEAN(x)) && !(JSVAL_TO_BOOLEAN(x))) #define JSVAL_IS_TRUE(x) ((JSVAL_IS_BOOLEAN(x)) && (JSVAL_TO_BOOLEAN(x))) -static JSBool +static bool stringToId(JSContext *cx, const char *s, jsid *idp) { JSString *str = JS_NewStringCopyZ(cx, s); diff --git a/js/src/jsapi-tests/testIndexToString.cpp b/js/src/jsapi-tests/testIndexToString.cpp index 385b6299711f5..bce421dc41c21 100644 --- a/js/src/jsapi-tests/testIndexToString.cpp +++ b/js/src/jsapi-tests/testIndexToString.cpp @@ -64,7 +64,7 @@ BEGIN_TEST(testIndexToString) if (!js::StaticStrings::hasUint(u)) CHECK(cx->compartment()->dtoaCache.lookup(10, u) == str); - JSBool match = false; + bool match = false; CHECK(JS_StringEqualsAscii(cx, str, tests[i].expected, &match)); CHECK(match); } diff --git a/js/src/jsapi-tests/testIntern.cpp b/js/src/jsapi-tests/testIntern.cpp index 87785b38b77d6..719152327c931 100644 --- a/js/src/jsapi-tests/testIntern.cpp +++ b/js/src/jsapi-tests/testIntern.cpp @@ -29,7 +29,7 @@ struct StringWrapperStruct } sw; void -FinalizeCallback(JSFreeOp *fop, JSFinalizeStatus status, JSBool isCompartmentGC) +FinalizeCallback(JSFreeOp *fop, JSFinalizeStatus status, bool isCompartmentGC) { if (status == JSFINALIZE_GROUP_START) sw.strOk = js::gc::IsStringMarked(&sw.str); diff --git a/js/src/jsapi-tests/testJSEvaluateScript.cpp b/js/src/jsapi-tests/testJSEvaluateScript.cpp index fe077f03e6ed2..f349963850060 100644 --- a/js/src/jsapi-tests/testJSEvaluateScript.cpp +++ b/js/src/jsapi-tests/testJSEvaluateScript.cpp @@ -18,7 +18,7 @@ BEGIN_TEST(testJSEvaluateScript) CHECK(JS_EvaluateScript(cx, obj, src, sizeof(src) - 1, __FILE__, __LINE__, retval.address())); - JSBool hasProp = true; + bool hasProp = true; CHECK(JS_AlreadyHasOwnProperty(cx, obj, "x", &hasProp)); CHECK(!hasProp); diff --git a/js/src/jsapi-tests/testLookup.cpp b/js/src/jsapi-tests/testLookup.cpp index 3965f96ff28ca..d861ca342f5f7 100644 --- a/js/src/jsapi-tests/testLookup.cpp +++ b/js/src/jsapi-tests/testLookup.cpp @@ -49,7 +49,7 @@ static JSClass DocumentAllClass = { JS_ConvertStub }; -JSBool +bool document_resolve(JSContext *cx, JS::HandleObject obj, JS::HandleId id, unsigned flags, JS::MutableHandleObject objp) { @@ -67,7 +67,7 @@ document_resolve(JSContext *cx, JS::HandleObject obj, JS::HandleId id, unsigned if (!docAll) return false; JS::Rooted allValue(cx, ObjectValue(*docAll)); - JSBool ok = JS_DefinePropertyById(cx, obj, id, allValue, NULL, NULL, 0); + bool ok = JS_DefinePropertyById(cx, obj, id, allValue, NULL, NULL, 0); objp.set(ok ? obj.get() : NULL); return ok; } diff --git a/js/src/jsapi-tests/testLooselyEqual.cpp b/js/src/jsapi-tests/testLooselyEqual.cpp index 4b86e73c36fbb..44c3187237d3d 100644 --- a/js/src/jsapi-tests/testLooselyEqual.cpp +++ b/js/src/jsapi-tests/testLooselyEqual.cpp @@ -14,14 +14,14 @@ struct LooseEqualityFixture : public JSAPITest virtual ~LooseEqualityFixture() {} bool leq(JS::HandleValue x, JS::HandleValue y) { - JSBool equal; + bool equal; CHECK(JS_LooselyEqual(cx, x, y, &equal) && equal); CHECK(JS_LooselyEqual(cx, y, x, &equal) && equal); return true; } bool nleq(JS::HandleValue x, JS::HandleValue y) { - JSBool equal; + bool equal; CHECK(JS_LooselyEqual(cx, x, y, &equal) && !equal); CHECK(JS_LooselyEqual(cx, y, x, &equal) && !equal); return true; diff --git a/js/src/jsapi-tests/testOps.cpp b/js/src/jsapi-tests/testOps.cpp index adbfbf2decbfe..d2abdcfc93cf2 100644 --- a/js/src/jsapi-tests/testOps.cpp +++ b/js/src/jsapi-tests/testOps.cpp @@ -9,7 +9,7 @@ #include "jsapi-tests/tests.h" -static JSBool +static bool my_convert(JSContext* context, JS::HandleObject obj, JSType type, JS::MutableHandleValue rval) { if (type == JSTYPE_VOID || type == JSTYPE_STRING || type == JSTYPE_NUMBER || type == JSTYPE_BOOLEAN) { diff --git a/js/src/jsapi-tests/testParseJSON.cpp b/js/src/jsapi-tests/testParseJSON.cpp index c0c10bcd68322..9699c4aa2b476 100644 --- a/js/src/jsapi-tests/testParseJSON.cpp +++ b/js/src/jsapi-tests/testParseJSON.cpp @@ -190,7 +190,7 @@ Error(JSContext *cx, const char (&input)[N]) CHECK(!JS_GetContextPrivate(cx)); JS_SetContextPrivate(cx, &p); JSErrorReporter old = JS_SetErrorReporter(cx, reportJSONEror); - JSBool ok = JS_ParseJSON(cx, str.chars(), str.length(), &dummy); + bool ok = JS_ParseJSON(cx, str.chars(), str.length(), &dummy); JS_SetErrorReporter(cx, old); JS_SetContextPrivate(cx, NULL); diff --git a/js/src/jsapi-tests/testProfileStrings.cpp b/js/src/jsapi-tests/testProfileStrings.cpp index cbdddbc430d7a..ee8fe4eb48761 100644 --- a/js/src/jsapi-tests/testProfileStrings.cpp +++ b/js/src/jsapi-tests/testProfileStrings.cpp @@ -198,7 +198,7 @@ BEGIN_TEST(testProfileStrings_isCalledWhenError) { JS::RootedValue rval(cx); /* Make sure the stack resets and we have an entry for each stack */ - JSBool ok = JS_CallFunctionName(cx, global, "check2", 0, NULL, rval.address()); + bool ok = JS_CallFunctionName(cx, global, "check2", 0, NULL, rval.address()); CHECK(!ok); CHECK(psize == 0); CHECK(cx->runtime()->spsProfiler.stringsCount() == 1); diff --git a/js/src/jsapi-tests/testPropCache.cpp b/js/src/jsapi-tests/testPropCache.cpp index 532f58eccc1aa..70783779cb669 100644 --- a/js/src/jsapi-tests/testPropCache.cpp +++ b/js/src/jsapi-tests/testPropCache.cpp @@ -9,7 +9,7 @@ static int g_counter; -static JSBool +static bool CounterAdd(JSContext *cx, JS::HandleObject obj, JS::HandleId id, JS::MutableHandleValue vp) { g_counter++; diff --git a/js/src/jsapi-tests/testResolveRecursion.cpp b/js/src/jsapi-tests/testResolveRecursion.cpp index 559a3bdab551f..ebdf33535f6d6 100644 --- a/js/src/jsapi-tests/testResolveRecursion.cpp +++ b/js/src/jsapi-tests/testResolveRecursion.cpp @@ -132,7 +132,7 @@ doResolve(JS::HandleObject obj, JS::HandleId id, unsigned flags, JS::MutableHand return false; } -static JSBool +static bool my_resolve(JSContext *cx, JS::HandleObject obj, JS::HandleId id, unsigned flags, JS::MutableHandleObject objp) { diff --git a/js/src/jsapi-tests/testSameValue.cpp b/js/src/jsapi-tests/testSameValue.cpp index 5a00ff0400ed2..ddd468e6b8e77 100644 --- a/js/src/jsapi-tests/testSameValue.cpp +++ b/js/src/jsapi-tests/testSameValue.cpp @@ -19,7 +19,7 @@ BEGIN_TEST(testSameValue) */ jsval v1 = DOUBLE_TO_JSVAL(0.0); jsval v2 = DOUBLE_TO_JSVAL(-0.0); - JSBool same; + bool same; CHECK(JS_SameValue(cx, v1, v2, &same)); CHECK(!same); return true; diff --git a/js/src/jsapi-tests/testSetProperty.cpp b/js/src/jsapi-tests/testSetProperty.cpp index e4e16f2f36b0d..d59025eca328e 100644 --- a/js/src/jsapi-tests/testSetProperty.cpp +++ b/js/src/jsapi-tests/testSetProperty.cpp @@ -7,7 +7,7 @@ #include "jsapi-tests/tests.h" -static JSBool +static bool nativeGet(JSContext *cx, JS::HandleObject obj, JS::HandleId id, JS::MutableHandleValue vp) { vp.set(INT_TO_JSVAL(17)); diff --git a/js/src/jsapi-tests/testSlowScript.cpp b/js/src/jsapi-tests/testSlowScript.cpp index f7adb623cd91f..205edc107d974 100644 --- a/js/src/jsapi-tests/testSlowScript.cpp +++ b/js/src/jsapi-tests/testSlowScript.cpp @@ -4,7 +4,7 @@ #include "jsapi-tests/tests.h" -JSBool +bool OperationCallback(JSContext *cx) { return false; @@ -12,7 +12,7 @@ OperationCallback(JSContext *cx) static unsigned sRemain; -JSBool +bool TriggerOperationCallback(JSContext *cx, unsigned argc, jsval *vp) { if (!sRemain--) diff --git a/js/src/jsapi-tests/testSourcePolicy.cpp b/js/src/jsapi-tests/testSourcePolicy.cpp index 10ee876b792d9..9b1d7218c7876 100644 --- a/js/src/jsapi-tests/testSourcePolicy.cpp +++ b/js/src/jsapi-tests/testSourcePolicy.cpp @@ -30,14 +30,14 @@ static void newScriptHook(JSContext *cx, const char *fn, unsigned lineno, JSScript *script, JSFunction *fun, void *data) { - if (!JS_StringEqualsAscii(cx, script->sourceData(cx), simpleSource, (JSBool *)data)) - *((JSBool *)data) = false; + if (!JS_StringEqualsAscii(cx, script->sourceData(cx), simpleSource, (bool *)data)) + *((bool *)data) = false; } BEGIN_TEST(testScriptSourceReentrant) { JS::CompileOptions opts(cx); - JSBool match = false; + bool match = false; JS_SetNewScriptHook(rt, newScriptHook, &match); CHECK(JS::Evaluate(cx, global, opts, simpleSource, strlen(simpleSource), NULL)); CHECK(match); diff --git a/js/src/jsapi-tests/testValueABI.cpp b/js/src/jsapi-tests/testValueABI.cpp index 8b4ec7a75a3ae..f8b3b38049d94 100644 --- a/js/src/jsapi-tests/testValueABI.cpp +++ b/js/src/jsapi-tests/testValueABI.cpp @@ -16,7 +16,7 @@ extern "C" { -extern JSBool +extern bool C_ValueToObject(JSContext *cx, jsval v, JSObject **obj); extern jsval @@ -33,7 +33,7 @@ BEGIN_TEST(testValueABI_retparam) jsval v = OBJECT_TO_JSVAL(obj); obj = NULL; CHECK(C_ValueToObject(cx, v, obj.address())); - JSBool equal; + bool equal; CHECK(JS_StrictlyEqual(cx, v, OBJECT_TO_JSVAL(obj), &equal)); CHECK(equal); diff --git a/js/src/jsapi-tests/testXDR.cpp b/js/src/jsapi-tests/testXDR.cpp index a0c06658fb9dd..97f8f8f3f0171 100644 --- a/js/src/jsapi-tests/testXDR.cpp +++ b/js/src/jsapi-tests/testXDR.cpp @@ -138,7 +138,7 @@ JSScript *createScriptViaXDR(JSPrincipals *prin, JSPrincipals *orig, int testCas } JS::RootedValue v(cx); - JSBool ok = JS_ExecuteScript(cx, global, script, v.address()); + bool ok = JS_ExecuteScript(cx, global, script, v.address()); if (!ok || !v.isObject()) return NULL; JS::RootedObject funobj(cx, &v.toObject()); @@ -214,7 +214,7 @@ BEGIN_TEST(testXDR_source) CHECK(script); JSString *out = JS_DecompileScript(cx, script, "testing", 0); CHECK(out); - JSBool equal; + bool equal; CHECK(JS_StringEqualsAscii(cx, out, *s, &equal)); CHECK(equal); } diff --git a/js/src/jsapi-tests/tests.h b/js/src/jsapi-tests/tests.h index 4edd2361cf820..91c8011cf6daa 100644 --- a/js/src/jsapi-tests/tests.h +++ b/js/src/jsapi-tests/tests.h @@ -187,7 +187,7 @@ class JSAPITest bool checkSame(jsval actualArg, jsval expectedArg, const char *actualExpr, const char *expectedExpr, const char *filename, int lineno) { - JSBool same; + bool same; JS::RootedValue actual(cx, actualArg), expected(cx, expectedArg); return (JS_SameValue(cx, actual, expected, &same) && same) || fail(JSAPITestString("CHECK_SAME failed: expected JS_SameValue(cx, ") + @@ -237,7 +237,7 @@ class JSAPITest } protected: - static JSBool + static bool print(JSContext *cx, unsigned argc, jsval *vp) { jsval *argv = JS_ARGV(cx, vp); diff --git a/js/src/jsapi-tests/valueABI.c b/js/src/jsapi-tests/valueABI.c index 65b31d38c48ee..9ac5d413c07a2 100644 --- a/js/src/jsapi-tests/valueABI.c +++ b/js/src/jsapi-tests/valueABI.c @@ -8,7 +8,7 @@ /* See testValueABI.cpp */ -JSBool +bool C_ValueToObject(JSContext *cx, jsval v, JSObject **obj) { return JS_ValueToObject(cx, v, obj); diff --git a/js/src/jsapi.cpp b/js/src/jsapi.cpp index 625d532260d91..9580c9fc13c65 100644 --- a/js/src/jsapi.cpp +++ b/js/src/jsapi.cpp @@ -221,11 +221,11 @@ AssertHeapIsIdleOrStringIsFlat(JSContext *cx, JSString *str) JS_ASSERT_IF(cx->runtime()->isHeapBusy(), str->isFlat()); } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_ConvertArguments(JSContext *cx, unsigned argc, jsval *argv, const char *format, ...) { va_list ap; - JSBool ok; + bool ok; AssertHeapIsIdle(cx); @@ -235,11 +235,11 @@ JS_ConvertArguments(JSContext *cx, unsigned argc, jsval *argv, const char *forma return ok; } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_ConvertArgumentsVA(JSContext *cx, unsigned argc, jsval *argv, const char *format, va_list ap) { jsval *sp; - JSBool required; + bool required; char c; double d; JSString *str; @@ -275,7 +275,7 @@ JS_ConvertArgumentsVA(JSContext *cx, unsigned argc, jsval *argv, const char *for } switch (c) { case 'b': - *va_arg(ap, JSBool *) = ToBoolean(*sp); + *va_arg(ap, bool *) = ToBoolean(*sp); break; case 'c': if (!JS_ValueToUint16(cx, *sp, va_arg(ap, uint16_t *))) @@ -345,11 +345,11 @@ JS_ConvertArgumentsVA(JSContext *cx, unsigned argc, jsval *argv, const char *for return true; } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_ConvertValue(JSContext *cx, jsval valueArg, JSType type, jsval *vp) { RootedValue value(cx, valueArg); - JSBool ok; + bool ok; RootedObject obj(cx); JSString *str; double d; @@ -397,7 +397,7 @@ JS_ConvertValue(JSContext *cx, jsval valueArg, JSType type, jsval *vp) return ok; } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_ValueToObject(JSContext *cx, jsval valueArg, JSObject **objpArg) { RootedValue value(cx, valueArg); @@ -451,14 +451,14 @@ JS_ValueToSource(JSContext *cx, jsval valueArg) return ValueToSource(cx, value); } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_ValueToNumber(JSContext *cx, jsval valueArg, double *dp) { RootedValue value(cx, valueArg); return JS::ToNumber(cx, value, dp); } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_DoubleIsInt32(double d, int32_t *ip) { return mozilla::DoubleIsInt32(d, ip); @@ -476,35 +476,35 @@ JS_DoubleToUint32(double d) return ToUint32(d); } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_ValueToECMAInt32(JSContext *cx, jsval valueArg, int32_t *ip) { RootedValue value(cx, valueArg); return JS::ToInt32(cx, value, ip); } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_ValueToECMAUint32(JSContext *cx, jsval valueArg, uint32_t *ip) { RootedValue value(cx, valueArg); return JS::ToUint32(cx, value, ip); } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_ValueToInt64(JSContext *cx, jsval valueArg, int64_t *ip) { RootedValue value(cx, valueArg); return JS::ToInt64(cx, value, ip); } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_ValueToUint64(JSContext *cx, jsval valueArg, uint64_t *ip) { RootedValue value(cx, valueArg); return JS::ToUint64(cx, value, ip); } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_ValueToInt32(JSContext *cx, jsval vArg, int32_t *ip) { AssertHeapIsIdle(cx); @@ -535,15 +535,15 @@ JS_ValueToInt32(JSContext *cx, jsval vArg, int32_t *ip) return true; } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_ValueToUint16(JSContext *cx, jsval valueArg, uint16_t *ip) { RootedValue value(cx, valueArg); return ToUint16(cx, value, ip); } -JS_PUBLIC_API(JSBool) -JS_ValueToBoolean(JSContext *cx, jsval value, JSBool *bp) +JS_PUBLIC_API(bool) +JS_ValueToBoolean(JSContext *cx, jsval value, bool *bp) { AssertHeapIsIdle(cx); CHECK_REQUEST(cx); @@ -570,8 +570,8 @@ JS_GetTypeName(JSContext *cx, JSType type) return TypeStrings[type]; } -JS_PUBLIC_API(JSBool) -JS_StrictlyEqual(JSContext *cx, jsval value1, jsval value2, JSBool *equal) +JS_PUBLIC_API(bool) +JS_StrictlyEqual(JSContext *cx, jsval value1, jsval value2, bool *equal) { AssertHeapIsIdle(cx); CHECK_REQUEST(cx); @@ -583,8 +583,8 @@ JS_StrictlyEqual(JSContext *cx, jsval value1, jsval value2, JSBool *equal) return true; } -JS_PUBLIC_API(JSBool) -JS_LooselyEqual(JSContext *cx, jsval value1Arg, jsval value2Arg, JSBool *equal) +JS_PUBLIC_API(bool) +JS_LooselyEqual(JSContext *cx, jsval value1Arg, jsval value2Arg, bool *equal) { RootedValue value1(cx, value1Arg); RootedValue value2(cx, value2Arg); @@ -598,8 +598,8 @@ JS_LooselyEqual(JSContext *cx, jsval value1Arg, jsval value2Arg, JSBool *equal) return true; } -JS_PUBLIC_API(JSBool) -JS_SameValue(JSContext *cx, jsval value1, jsval value2, JSBool *same) +JS_PUBLIC_API(bool) +JS_SameValue(JSContext *cx, jsval value1, jsval value2, bool *same) { AssertHeapIsIdle(cx); CHECK_REQUEST(cx); @@ -611,13 +611,13 @@ JS_SameValue(JSContext *cx, jsval value1, jsval value2, JSBool *same) return true; } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_IsBuiltinEvalFunction(JSFunction *fun) { return IsAnyBuiltinEval(fun); } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_IsBuiltinFunctionConstructor(JSFunction *fun) { return fun->isBuiltinFunctionConstructor(); @@ -644,7 +644,7 @@ JS_IsBuiltinFunctionConstructor(JSFunction *fun) enum InitState { Uninitialized, Running, ShutDown }; static InitState jsInitState = Uninitialized; -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_Init(void) { MOZ_ASSERT(jsInitState == Uninitialized, @@ -844,7 +844,7 @@ JS_EndRequest(JSContext *cx) #endif } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_IsInRequest(JSRuntime *rt) { #ifdef JS_THREADSAFE @@ -1011,7 +1011,7 @@ JS_ToggleOptions(JSContext *cx, uint32_t options) } JS_PUBLIC_API(void) -JS_SetJitHardening(JSRuntime *rt, JSBool enabled) +JS_SetJitHardening(JSRuntime *rt, bool enabled) { rt->setJitHardening(!!enabled); } @@ -1108,7 +1108,7 @@ JS_GetCompartmentPrivate(JSCompartment *compartment) return compartment->data; } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_WrapObject(JSContext *cx, JSObject **objp) { AssertHeapIsIdle(cx); @@ -1118,7 +1118,7 @@ JS_WrapObject(JSContext *cx, JSObject **objp) return cx->compartment()->wrap(cx, objp); } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_WrapValue(JSContext *cx, jsval *vp) { AssertHeapIsIdle(cx); @@ -1131,7 +1131,7 @@ JS_WrapValue(JSContext *cx, jsval *vp) return ok; } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_WrapId(JSContext *cx, jsid *idp) { AssertHeapIsIdle(cx); @@ -1331,14 +1331,14 @@ js_TransplantObjectWithWrapper(JSContext *cx, * Gecko uses this to clear Xray wrappers when doing a navigation that reuses * the inner window and global object. */ -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_RefreshCrossCompartmentWrappers(JSContext *cx, JSObject *objArg) { RootedObject obj(cx, objArg); return RemapAllWrappersForObject(cx, obj, obj); } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_InitStandardClasses(JSContext *cx, JSObject *objArg) { RootedObject obj(cx, objArg); @@ -1507,8 +1507,8 @@ static const JSStdName object_prototype_names[] = { #undef EAGER_ATOM_CLASP #undef EAGER_ATOM_AND_CLASP -JS_PUBLIC_API(JSBool) -JS_ResolveStandardClass(JSContext *cx, HandleObject obj, HandleId id, JSBool *resolved) +JS_PUBLIC_API(bool) +JS_ResolveStandardClass(JSContext *cx, HandleObject obj, HandleId id, bool *resolved) { JSRuntime *rt; JSAtom *atom; @@ -1601,7 +1601,7 @@ JS_ResolveStandardClass(JSContext *cx, HandleObject obj, HandleId id, JSBool *re return true; } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_EnumerateStandardClasses(JSContext *cx, HandleObject obj) { AssertHeapIsIdle(cx); @@ -1633,7 +1633,7 @@ JS_EnumerateStandardClasses(JSContext *cx, HandleObject obj) return true; } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_GetClassObject(JSContext *cx, JSObject *obj, JSProtoKey key, JSObject **objpArg) { RootedObject objp(cx, *objpArg); @@ -1647,7 +1647,7 @@ JS_GetClassObject(JSContext *cx, JSObject *obj, JSProtoKey key, JSObject **objpA return true; } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_GetClassPrototype(JSContext *cx, JSProtoKey key, JSObject **objp_) { AssertHeapIsIdle(cx); @@ -1701,7 +1701,7 @@ JS_GetGlobalForObject(JSContext *cx, JSObject *obj) return &obj->global(); } -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_IsGlobalObject(JSObject *obj) { return obj->is(); @@ -1800,7 +1800,7 @@ JS_strdup(JSRuntime *rt, const char *s) #undef JS_AddRoot -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_AddValueRoot(JSContext *cx, jsval *vp) { AssertHeapIsIdle(cx); @@ -1808,7 +1808,7 @@ JS_AddValueRoot(JSContext *cx, jsval *vp) return AddValueRoot(cx, vp, NULL); } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_AddStringRoot(JSContext *cx, JSString **rp) { AssertHeapIsIdle(cx); @@ -1816,7 +1816,7 @@ JS_AddStringRoot(JSContext *cx, JSString **rp) return AddStringRoot(cx, rp, NULL); } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_AddObjectRoot(JSContext *cx, JSObject **rp) { AssertHeapIsIdle(cx); @@ -1824,7 +1824,7 @@ JS_AddObjectRoot(JSContext *cx, JSObject **rp) return AddObjectRoot(cx, rp, NULL); } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_AddNamedValueRoot(JSContext *cx, jsval *vp, const char *name) { AssertHeapIsIdle(cx); @@ -1832,13 +1832,13 @@ JS_AddNamedValueRoot(JSContext *cx, jsval *vp, const char *name) return AddValueRoot(cx, vp, name); } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_AddNamedValueRootRT(JSRuntime *rt, jsval *vp, const char *name) { return AddValueRootRT(rt, vp, name); } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_AddNamedStringRoot(JSContext *cx, JSString **rp, const char *name) { AssertHeapIsIdle(cx); @@ -1846,7 +1846,7 @@ JS_AddNamedStringRoot(JSContext *cx, JSString **rp, const char *name) return AddStringRoot(cx, rp, name); } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_AddNamedObjectRoot(JSContext *cx, JSObject **rp, const char *name) { AssertHeapIsIdle(cx); @@ -1854,7 +1854,7 @@ JS_AddNamedObjectRoot(JSContext *cx, JSObject **rp, const char *name) return AddObjectRoot(cx, rp, name); } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_AddNamedScriptRoot(JSContext *cx, JSScript **rp, const char *name) { AssertHeapIsIdle(cx); @@ -1921,7 +1921,7 @@ JS_AnchorPtr(void *p) { } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_AddExtraGCRootsTracer(JSRuntime *rt, JSTraceDataOp traceOp, void *data) { AssertHeapIsIdle(rt); @@ -2047,7 +2047,7 @@ CountDecimalDigits(size_t num) JS_PUBLIC_API(void) JS_GetTraceThingInfo(char *buf, size_t bufsize, JSTracer *trc, void *thing, - JSGCTraceKind kind, JSBool details) + JSGCTraceKind kind, bool details) { const char *name = NULL; /* silence uninitialized warning */ size_t n; @@ -2264,7 +2264,7 @@ DumpNotify(JSTracer *trc, void **thingp, JSGCTraceKind kind) } /* Dump node and the chain that leads to thing it contains. */ -static JSBool +static bool DumpNode(JSDumpingTracer *dtrc, FILE* fp, JSHeapDumpNode *node) { JSHeapDumpNode *prev, *following; @@ -2328,7 +2328,7 @@ DumpNode(JSDumpingTracer *dtrc, FILE* fp, JSHeapDumpNode *node) return ok && putc('\n', fp) >= 0; } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_DumpHeap(JSRuntime *rt, FILE *fp, void* startThing, JSGCTraceKind startKind, void *thingToFind, size_t maxDepth, void *thingToIgnore) { @@ -2408,7 +2408,7 @@ JS_DumpHeap(JSRuntime *rt, FILE *fp, void* startThing, JSGCTraceKind startKind, #endif /* DEBUG */ -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_IsGCMarkingTracer(JSTracer *trc) { return IS_GC_MARKING_TRACER(trc); @@ -2443,13 +2443,13 @@ JS_SetFinalizeCallback(JSRuntime *rt, JSFinalizeCallback cb) rt->gcFinalizeCallback = cb; } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_IsAboutToBeFinalized(JS::Heap *objp) { return IsObjectAboutToBeFinalized(objp->unsafeGet()); } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_IsAboutToBeFinalizedUnbarriered(JSObject **objp) { return IsObjectAboutToBeFinalized(objp); @@ -2585,7 +2585,7 @@ JS_NewExternalString(JSContext *cx, const jschar *chars, size_t length, return s; } -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_IsExternalString(JSString *str) { return str->isExternal(); @@ -2652,7 +2652,7 @@ JS_DestroyIdArray(JSContext *cx, JSIdArray *ida) cx->runtime()->defaultFreeOp()->free_(ida); } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_ValueToId(JSContext *cx, jsval valueArg, jsid *idp) { RootedValue value(cx, valueArg); @@ -2668,7 +2668,7 @@ JS_ValueToId(JSContext *cx, jsval valueArg, jsid *idp) return true; } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_IdToValue(JSContext *cx, jsid id, jsval *vp) { AssertHeapIsIdle(cx); @@ -2678,7 +2678,7 @@ JS_IdToValue(JSContext *cx, jsid id, jsval *vp) return true; } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_DefaultValue(JSContext *cx, JSObject *objArg, JSType hint, jsval *vp) { RootedObject obj(cx, objArg); @@ -2695,38 +2695,38 @@ JS_DefaultValue(JSContext *cx, JSObject *objArg, JSType hint, jsval *vp) return true; } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_PropertyStub(JSContext *cx, HandleObject obj, HandleId id, MutableHandleValue vp) { return true; } -JS_PUBLIC_API(JSBool) -JS_StrictPropertyStub(JSContext *cx, HandleObject obj, HandleId id, JSBool strict, MutableHandleValue vp) +JS_PUBLIC_API(bool) +JS_StrictPropertyStub(JSContext *cx, HandleObject obj, HandleId id, bool strict, MutableHandleValue vp) { return true; } -JS_PUBLIC_API(JSBool) -JS_DeletePropertyStub(JSContext *cx, HandleObject obj, HandleId id, JSBool *succeeded) +JS_PUBLIC_API(bool) +JS_DeletePropertyStub(JSContext *cx, HandleObject obj, HandleId id, bool *succeeded) { *succeeded = true; return true; } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_EnumerateStub(JSContext *cx, HandleObject obj) { return true; } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_ResolveStub(JSContext *cx, HandleObject obj, HandleId id) { return true; } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_ConvertStub(JSContext *cx, HandleObject obj, JSType type, MutableHandleValue vp) { JS_ASSERT(type != JSTYPE_OBJECT && type != JSTYPE_FUNCTION); @@ -2749,7 +2749,7 @@ JS_InitClass(JSContext *cx, JSObject *objArg, JSObject *parent_protoArg, nargs, ps, fs, static_ps, static_fs); } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_LinkConstructorAndPrototype(JSContext *cx, JSObject *ctorArg, JSObject *protoArg) { RootedObject ctor(cx, ctorArg); @@ -2763,7 +2763,7 @@ JS_GetClass(JSObject *obj) return obj->getJSClass(); } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_InstanceOf(JSContext *cx, JSObject *objArg, JSClass *clasp, jsval *argv) { RootedObject obj(cx, objArg); @@ -2783,8 +2783,8 @@ JS_InstanceOf(JSContext *cx, JSObject *objArg, JSClass *clasp, jsval *argv) return true; } -JS_PUBLIC_API(JSBool) -JS_HasInstance(JSContext *cx, JSObject *objArg, jsval valueArg, JSBool *bp) +JS_PUBLIC_API(bool) +JS_HasInstance(JSContext *cx, JSObject *objArg, jsval valueArg, bool *bp) { RootedObject obj(cx, objArg); RootedValue value(cx, valueArg); @@ -2821,13 +2821,13 @@ JS_GetInstancePrivate(JSContext *cx, JSObject *objArg, JSClass *clasp, jsval *ar return obj->getPrivate(); } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_GetPrototype(JSContext *cx, JS::Handle obj, JS::MutableHandle protop) { return JSObject::getProto(cx, obj, protop); } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_SetPrototype(JSContext *cx, JS::Handle obj, JS::Handle proto) { AssertHeapIsIdle(cx); @@ -2844,7 +2844,7 @@ JS_GetParent(JSObject *obj) return obj->getParent(); } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_SetParent(JSContext *cx, JSObject *objArg, JSObject *parentArg) { RootedObject obj(cx, objArg); @@ -2881,7 +2881,7 @@ JS_GetConstructor(JSContext *cx, JSObject *protoArg) return &cval.toObject(); } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_GetObjectId(JSContext *cx, JSObject *obj, jsid *idp) { AssertHeapIsIdle(cx); @@ -3031,8 +3031,8 @@ JS_NewObjectForConstructor(JSContext *cx, JSClass *clasp, const jsval *vp) return CreateThis(cx, Valueify(clasp), obj); } -JS_PUBLIC_API(JSBool) -JS_IsExtensible(JSContext *cx, HandleObject obj, JSBool *extensible) +JS_PUBLIC_API(bool) +JS_IsExtensible(JSContext *cx, HandleObject obj, bool *extensible) { bool isExtensible; if (!JSObject::isExtensible(cx, obj, &isExtensible)) @@ -3041,7 +3041,7 @@ JS_IsExtensible(JSContext *cx, HandleObject obj, JSBool *extensible) return true; } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_IsNative(JSObject *obj) { return obj->isNative(); @@ -3053,7 +3053,7 @@ JS_GetObjectRuntime(JSObject *obj) return obj->compartment()->runtimeFromMainThread(); } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_FreezeObject(JSContext *cx, JSObject *objArg) { RootedObject obj(cx, objArg); @@ -3064,7 +3064,7 @@ JS_FreezeObject(JSContext *cx, JSObject *objArg) return JSObject::freeze(cx, obj); } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_DeepFreezeObject(JSContext *cx, JSObject *objArg) { RootedObject obj(cx, objArg); @@ -3095,7 +3095,7 @@ JS_DeepFreezeObject(JSContext *cx, JSObject *objArg) return true; } -static JSBool +static bool LookupPropertyById(JSContext *cx, HandleObject obj, HandleId id, unsigned flags, MutableHandleObject objp, MutableHandleShape propp) { @@ -3109,7 +3109,7 @@ LookupPropertyById(JSContext *cx, HandleObject obj, HandleId id, unsigned flags, #define AUTO_NAMELEN(s,n) (((n) == (size_t)-1) ? js_strlen(s) : (n)) -static JSBool +static bool LookupResult(JSContext *cx, HandleObject obj, HandleObject obj2, HandleId id, HandleShape shape, MutableHandleValue vp) { @@ -3145,7 +3145,7 @@ LookupResult(JSContext *cx, HandleObject obj, HandleObject obj2, HandleId id, return true; } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_LookupPropertyById(JSContext *cx, JSObject *objArg, jsid idArg, MutableHandleValue vp) { RootedId id(cx, idArg); @@ -3157,7 +3157,7 @@ JS_LookupPropertyById(JSContext *cx, JSObject *objArg, jsid idArg, MutableHandle LookupResult(cx, obj, obj2, id, prop, vp); } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_LookupElement(JSContext *cx, JSObject *objArg, uint32_t index, MutableHandleValue vp) { RootedObject obj(cx, objArg); @@ -3168,7 +3168,7 @@ JS_LookupElement(JSContext *cx, JSObject *objArg, uint32_t index, MutableHandleV return JS_LookupPropertyById(cx, obj, id, vp); } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_LookupProperty(JSContext *cx, JSObject *objArg, const char *name, MutableHandleValue vp) { RootedObject obj(cx, objArg); @@ -3176,7 +3176,7 @@ JS_LookupProperty(JSContext *cx, JSObject *objArg, const char *name, MutableHand return atom && JS_LookupPropertyById(cx, obj, AtomToId(atom), vp); } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_LookupUCProperty(JSContext *cx, JSObject *objArg, const jschar *name, size_t namelen, MutableHandleValue vp) { @@ -3185,7 +3185,7 @@ JS_LookupUCProperty(JSContext *cx, JSObject *objArg, const jschar *name, size_t return atom && JS_LookupPropertyById(cx, obj, AtomToId(atom), vp); } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_LookupPropertyWithFlagsById(JSContext *cx, JSObject *objArg, jsid id_, unsigned flags, JSObject **objpArg, MutableHandleValue vp) { @@ -3209,7 +3209,7 @@ JS_LookupPropertyWithFlagsById(JSContext *cx, JSObject *objArg, jsid id_, unsign return true; } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_LookupPropertyWithFlags(JSContext *cx, JSObject *objArg, const char *name, unsigned flags, MutableHandleValue vp) { @@ -3219,20 +3219,20 @@ JS_LookupPropertyWithFlags(JSContext *cx, JSObject *objArg, const char *name, un return atom && JS_LookupPropertyWithFlagsById(cx, obj, AtomToId(atom), flags, &obj2, vp); } -JS_PUBLIC_API(JSBool) -JS_HasPropertyById(JSContext *cx, JSObject *objArg, jsid idArg, JSBool *foundp) +JS_PUBLIC_API(bool) +JS_HasPropertyById(JSContext *cx, JSObject *objArg, jsid idArg, bool *foundp) { RootedObject obj(cx, objArg); RootedId id(cx, idArg); RootedObject obj2(cx); RootedShape prop(cx); - JSBool ok = LookupPropertyById(cx, obj, id, 0, &obj2, &prop); + bool ok = LookupPropertyById(cx, obj, id, 0, &obj2, &prop); *foundp = (prop != NULL); return ok; } -JS_PUBLIC_API(JSBool) -JS_HasElement(JSContext *cx, JSObject *objArg, uint32_t index, JSBool *foundp) +JS_PUBLIC_API(bool) +JS_HasElement(JSContext *cx, JSObject *objArg, uint32_t index, bool *foundp) { RootedObject obj(cx, objArg); AssertHeapIsIdle(cx); @@ -3243,24 +3243,24 @@ JS_HasElement(JSContext *cx, JSObject *objArg, uint32_t index, JSBool *foundp) return JS_HasPropertyById(cx, obj, id, foundp); } -JS_PUBLIC_API(JSBool) -JS_HasProperty(JSContext *cx, JSObject *objArg, const char *name, JSBool *foundp) +JS_PUBLIC_API(bool) +JS_HasProperty(JSContext *cx, JSObject *objArg, const char *name, bool *foundp) { RootedObject obj(cx, objArg); JSAtom *atom = Atomize(cx, name, strlen(name)); return atom && JS_HasPropertyById(cx, obj, AtomToId(atom), foundp); } -JS_PUBLIC_API(JSBool) -JS_HasUCProperty(JSContext *cx, JSObject *objArg, const jschar *name, size_t namelen, JSBool *foundp) +JS_PUBLIC_API(bool) +JS_HasUCProperty(JSContext *cx, JSObject *objArg, const jschar *name, size_t namelen, bool *foundp) { RootedObject obj(cx, objArg); JSAtom *atom = AtomizeChars(cx, name, AUTO_NAMELEN(name, namelen)); return atom && JS_HasPropertyById(cx, obj, AtomToId(atom), foundp); } -JS_PUBLIC_API(JSBool) -JS_AlreadyHasOwnPropertyById(JSContext *cx, JSObject *objArg, jsid id_, JSBool *foundp) +JS_PUBLIC_API(bool) +JS_AlreadyHasOwnPropertyById(JSContext *cx, JSObject *objArg, jsid id_, bool *foundp) { RootedObject obj(cx, objArg); RootedId id(cx, id_); @@ -3287,8 +3287,8 @@ JS_AlreadyHasOwnPropertyById(JSContext *cx, JSObject *objArg, jsid id_, JSBool * return true; } -JS_PUBLIC_API(JSBool) -JS_AlreadyHasOwnElement(JSContext *cx, JSObject *objArg, uint32_t index, JSBool *foundp) +JS_PUBLIC_API(bool) +JS_AlreadyHasOwnElement(JSContext *cx, JSObject *objArg, uint32_t index, bool *foundp) { RootedObject obj(cx, objArg); AssertHeapIsIdle(cx); @@ -3299,17 +3299,17 @@ JS_AlreadyHasOwnElement(JSContext *cx, JSObject *objArg, uint32_t index, JSBool return JS_AlreadyHasOwnPropertyById(cx, obj, id, foundp); } -JS_PUBLIC_API(JSBool) -JS_AlreadyHasOwnProperty(JSContext *cx, JSObject *objArg, const char *name, JSBool *foundp) +JS_PUBLIC_API(bool) +JS_AlreadyHasOwnProperty(JSContext *cx, JSObject *objArg, const char *name, bool *foundp) { RootedObject obj(cx, objArg); JSAtom *atom = Atomize(cx, name, strlen(name)); return atom && JS_AlreadyHasOwnPropertyById(cx, obj, AtomToId(atom), foundp); } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_AlreadyHasOwnUCProperty(JSContext *cx, JSObject *objArg, const jschar *name, size_t namelen, - JSBool *foundp) + bool *foundp) { RootedObject obj(cx, objArg); JSAtom *atom = AtomizeChars(cx, name, AUTO_NAMELEN(name, namelen)); @@ -3337,7 +3337,7 @@ SetterWrapper(JSStrictPropertyOp setter) return ret; } -static JSBool +static bool DefinePropertyById(JSContext *cx, HandleObject obj, HandleId id, HandleValue value, const JSPropertyOpWrapper &get, const JSStrictPropertyOpWrapper &set, unsigned attrs, unsigned flags, int tinyid) @@ -3415,7 +3415,7 @@ DefinePropertyById(JSContext *cx, HandleObject obj, HandleId id, HandleValue val return JSObject::defineGeneric(cx, obj, id, value, getter, setter, attrs); } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_DefinePropertyById(JSContext *cx, JSObject *objArg, jsid idArg, jsval valueArg, JSPropertyOp getter, JSStrictPropertyOp setter, unsigned attrs) { @@ -3426,7 +3426,7 @@ JS_DefinePropertyById(JSContext *cx, JSObject *objArg, jsid idArg, jsval valueAr SetterWrapper(setter), attrs, 0, 0); } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_DefineElement(JSContext *cx, JSObject *objArg, uint32_t index, jsval valueArg, JSPropertyOp getter, JSStrictPropertyOp setter, unsigned attrs) { @@ -3442,7 +3442,7 @@ JS_DefineElement(JSContext *cx, JSObject *objArg, uint32_t index, jsval valueArg SetterWrapper(setter), attrs, 0, 0); } -static JSBool +static bool DefineProperty(JSContext *cx, HandleObject obj, const char *name, const Value &value_, const JSPropertyOpWrapper &getter, const JSStrictPropertyOpWrapper &setter, unsigned attrs, unsigned flags, int tinyid) @@ -3465,7 +3465,7 @@ DefineProperty(JSContext *cx, HandleObject obj, const char *name, const Value &v return DefinePropertyById(cx, obj, id, value, getter, setter, attrs, flags, tinyid); } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_DefineProperty(JSContext *cx, JSObject *objArg, const char *name, jsval valueArg, PropertyOp getter, JSStrictPropertyOp setter, unsigned attrs) { @@ -3475,7 +3475,7 @@ JS_DefineProperty(JSContext *cx, JSObject *objArg, const char *name, jsval value SetterWrapper(setter), attrs, 0, 0); } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_DefinePropertyWithTinyId(JSContext *cx, JSObject *objArg, const char *name, int8_t tinyid, jsval valueArg, PropertyOp getter, JSStrictPropertyOp setter, unsigned attrs) { @@ -3485,7 +3485,7 @@ JS_DefinePropertyWithTinyId(JSContext *cx, JSObject *objArg, const char *name, i SetterWrapper(setter), attrs, Shape::HAS_SHORTID, tinyid); } -static JSBool +static bool DefineUCProperty(JSContext *cx, HandleObject obj, const jschar *name, size_t namelen, const Value &value_, PropertyOp getter, StrictPropertyOp setter, unsigned attrs, unsigned flags, int tinyid) @@ -3500,7 +3500,7 @@ DefineUCProperty(JSContext *cx, HandleObject obj, const jschar *name, size_t nam SetterWrapper(setter), attrs, flags, tinyid); } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_DefineUCProperty(JSContext *cx, JSObject *objArg, const jschar *name, size_t namelen, jsval valueArg, JSPropertyOp getter, JSStrictPropertyOp setter, unsigned attrs) { @@ -3509,7 +3509,7 @@ JS_DefineUCProperty(JSContext *cx, JSObject *objArg, const jschar *name, size_t return DefineUCProperty(cx, obj, name, namelen, value, getter, setter, attrs, 0, 0); } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_DefineUCPropertyWithTinyId(JSContext *cx, JSObject *objArg, const jschar *name, size_t namelen, int8_t tinyid, jsval valueArg, JSPropertyOp getter, JSStrictPropertyOp setter, unsigned attrs) @@ -3520,8 +3520,8 @@ JS_DefineUCPropertyWithTinyId(JSContext *cx, JSObject *objArg, const jschar *nam Shape::HAS_SHORTID, tinyid); } -JS_PUBLIC_API(JSBool) -JS_DefineOwnProperty(JSContext *cx, JSObject *objArg, jsid idArg, jsval descriptorArg, JSBool *bp) +JS_PUBLIC_API(bool) +JS_DefineOwnProperty(JSContext *cx, JSObject *objArg, jsid idArg, jsval descriptorArg, bool *bp) { RootedObject obj(cx, objArg); RootedId id(cx, idArg); @@ -3560,11 +3560,11 @@ JS_DefineObject(JSContext *cx, JSObject *objArg, const char *name, JSClass *jscl return nobj; } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_DefineConstDoubles(JSContext *cx, JSObject *objArg, const JSConstDoubleSpec *cds) { RootedObject obj(cx, objArg); - JSBool ok; + bool ok; unsigned attrs; AssertHeapIsIdle(cx); @@ -3583,11 +3583,11 @@ JS_DefineConstDoubles(JSContext *cx, JSObject *objArg, const JSConstDoubleSpec * return ok; } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_DefineProperties(JSContext *cx, JSObject *objArg, const JSPropertySpec *ps) { RootedObject obj(cx, objArg); - JSBool ok; + bool ok; for (ok = true; ps->name; ps++) { ok = DefineProperty(cx, obj, ps->name, UndefinedValue(), ps->getter, ps->setter, ps->flags, Shape::HAS_SHORTID, ps->tinyid); @@ -3597,9 +3597,9 @@ JS_DefineProperties(JSContext *cx, JSObject *objArg, const JSPropertySpec *ps) return ok; } -static JSBool +static bool GetPropertyDescriptorById(JSContext *cx, HandleObject obj, HandleId id, unsigned flags, - JSBool own, PropertyDescriptor *desc) + bool own, PropertyDescriptor *desc) { RootedObject obj2(cx); RootedShape shape(cx); @@ -3648,7 +3648,7 @@ GetPropertyDescriptorById(JSContext *cx, HandleObject obj, HandleId id, unsigned return true; } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_GetPropertyDescriptorById(JSContext *cx, JSObject *objArg, jsid idArg, unsigned flags, JSPropertyDescriptor *desc_) { @@ -3661,9 +3661,9 @@ JS_GetPropertyDescriptorById(JSContext *cx, JSObject *objArg, jsid idArg, unsign return true; } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_GetPropertyAttrsGetterAndSetterById(JSContext *cx, JSObject *objArg, jsid idArg, - unsigned *attrsp, JSBool *foundp, + unsigned *attrsp, bool *foundp, JSPropertyOp *getterp, JSStrictPropertyOp *setterp) { RootedObject obj(cx, objArg); @@ -3681,9 +3681,9 @@ JS_GetPropertyAttrsGetterAndSetterById(JSContext *cx, JSObject *objArg, jsid idA return true; } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_GetPropertyAttributes(JSContext *cx, JSObject *objArg, const char *name, - unsigned *attrsp, JSBool *foundp) + unsigned *attrsp, bool *foundp) { RootedObject obj(cx, objArg); JSAtom *atom = Atomize(cx, name, strlen(name)); @@ -3691,9 +3691,9 @@ JS_GetPropertyAttributes(JSContext *cx, JSObject *objArg, const char *name, attrsp, foundp, NULL, NULL); } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_GetUCPropertyAttributes(JSContext *cx, JSObject *objArg, const jschar *name, size_t namelen, - unsigned *attrsp, JSBool *foundp) + unsigned *attrsp, bool *foundp) { RootedObject obj(cx, objArg); JSAtom *atom = AtomizeChars(cx, name, AUTO_NAMELEN(name, namelen)); @@ -3701,9 +3701,9 @@ JS_GetUCPropertyAttributes(JSContext *cx, JSObject *objArg, const jschar *name, attrsp, foundp, NULL, NULL); } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_GetPropertyAttrsGetterAndSetter(JSContext *cx, JSObject *objArg, const char *name, - unsigned *attrsp, JSBool *foundp, + unsigned *attrsp, bool *foundp, JSPropertyOp *getterp, JSStrictPropertyOp *setterp) { RootedObject obj(cx, objArg); @@ -3712,10 +3712,10 @@ JS_GetPropertyAttrsGetterAndSetter(JSContext *cx, JSObject *objArg, const char * attrsp, foundp, getterp, setterp); } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_GetUCPropertyAttrsGetterAndSetter(JSContext *cx, JSObject *objArg, const jschar *name, size_t namelen, - unsigned *attrsp, JSBool *foundp, + unsigned *attrsp, bool *foundp, JSPropertyOp *getterp, JSStrictPropertyOp *setterp) { RootedObject obj(cx, objArg); @@ -3724,7 +3724,7 @@ JS_GetUCPropertyAttrsGetterAndSetter(JSContext *cx, JSObject *objArg, attrsp, foundp, getterp, setterp); } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_GetOwnPropertyDescriptor(JSContext *cx, JSObject *objArg, jsid idArg, MutableHandleValue vp) { RootedObject obj(cx, objArg); @@ -3735,8 +3735,8 @@ JS_GetOwnPropertyDescriptor(JSContext *cx, JSObject *objArg, jsid idArg, Mutable return GetOwnPropertyDescriptor(cx, obj, id, vp); } -static JSBool -SetPropertyAttributesById(JSContext *cx, HandleObject obj, HandleId id, unsigned attrs, JSBool *foundp) +static bool +SetPropertyAttributesById(JSContext *cx, HandleObject obj, HandleId id, unsigned attrs, bool *foundp) { RootedObject obj2(cx); RootedShape shape(cx); @@ -3747,7 +3747,7 @@ SetPropertyAttributesById(JSContext *cx, HandleObject obj, HandleId id, unsigned *foundp = false; return true; } - JSBool ok = obj->isNative() + bool ok = obj->isNative() ? JSObject::changePropertyAttributes(cx, obj, shape, attrs) : JSObject::setGenericAttributes(cx, obj, id, &attrs); if (ok) @@ -3755,9 +3755,9 @@ SetPropertyAttributesById(JSContext *cx, HandleObject obj, HandleId id, unsigned return ok; } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_SetPropertyAttributes(JSContext *cx, JSObject *objArg, const char *name, - unsigned attrs, JSBool *foundp) + unsigned attrs, bool *foundp) { RootedObject obj(cx, objArg); JSAtom *atom = Atomize(cx, name, strlen(name)); @@ -3765,9 +3765,9 @@ JS_SetPropertyAttributes(JSContext *cx, JSObject *objArg, const char *name, return atom && SetPropertyAttributesById(cx, obj, id, attrs, foundp); } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_SetUCPropertyAttributes(JSContext *cx, JSObject *objArg, const jschar *name, size_t namelen, - unsigned attrs, JSBool *foundp) + unsigned attrs, bool *foundp) { RootedObject obj(cx, objArg); JSAtom *atom = AtomizeChars(cx, name, AUTO_NAMELEN(name, namelen)); @@ -3775,13 +3775,13 @@ JS_SetUCPropertyAttributes(JSContext *cx, JSObject *objArg, const jschar *name, return atom && SetPropertyAttributesById(cx, obj, id, attrs, foundp); } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_GetPropertyById(JSContext *cx, JSObject *objArg, jsid idArg, MutableHandleValue vp) { return JS_ForwardGetPropertyTo(cx, objArg, idArg, objArg, vp); } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_ForwardGetPropertyTo(JSContext *cx, JSObject *objArg, jsid idArg, JSObject *onBehalfOfArg, MutableHandleValue vp) { @@ -3798,7 +3798,7 @@ JS_ForwardGetPropertyTo(JSContext *cx, JSObject *objArg, jsid idArg, JSObject *o return JSObject::getGeneric(cx, obj, onBehalfOf, id, vp); } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_GetPropertyByIdDefault(JSContext *cx, JSObject *objArg, jsid idArg, jsval defArg, MutableHandleValue vp) { @@ -3809,13 +3809,13 @@ JS_GetPropertyByIdDefault(JSContext *cx, JSObject *objArg, jsid idArg, jsval def return baseops::GetPropertyDefault(cx, obj, id, def, vp); } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_GetElement(JSContext *cx, JSObject *objArg, uint32_t index, MutableHandleValue vp) { return JS_ForwardGetElementTo(cx, objArg, index, objArg, vp); } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_ForwardGetElementTo(JSContext *cx, JSObject *objArg, uint32_t index, JSObject *onBehalfOfArg, MutableHandleValue vp) { @@ -3829,9 +3829,9 @@ JS_ForwardGetElementTo(JSContext *cx, JSObject *objArg, uint32_t index, JSObject return JSObject::getElement(cx, obj, onBehalfOf, index, vp); } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_GetElementIfPresent(JSContext *cx, JSObject *objArg, uint32_t index, JSObject *onBehalfOfArg, - MutableHandleValue vp, JSBool* present) + MutableHandleValue vp, bool* present) { RootedObject obj(cx, objArg); RootedObject onBehalfOf(cx, onBehalfOfArg); @@ -3848,7 +3848,7 @@ JS_GetElementIfPresent(JSContext *cx, JSObject *objArg, uint32_t index, JSObject return true; } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_GetProperty(JSContext *cx, JSObject *objArg, const char *name, MutableHandleValue vp) { RootedObject obj(cx, objArg); @@ -3856,7 +3856,7 @@ JS_GetProperty(JSContext *cx, JSObject *objArg, const char *name, MutableHandleV return atom && JS_GetPropertyById(cx, obj, AtomToId(atom), vp); } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_GetPropertyDefault(JSContext *cx, JSObject *objArg, const char *name, jsval defArg, MutableHandleValue vp) { @@ -3866,7 +3866,7 @@ JS_GetPropertyDefault(JSContext *cx, JSObject *objArg, const char *name, jsval d return atom && JS_GetPropertyByIdDefault(cx, obj, AtomToId(atom), def, vp); } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_GetUCProperty(JSContext *cx, JSObject *objArg, const jschar *name, size_t namelen, MutableHandleValue vp) { @@ -3875,7 +3875,7 @@ JS_GetUCProperty(JSContext *cx, JSObject *objArg, const jschar *name, size_t nam return atom && JS_GetPropertyById(cx, obj, AtomToId(atom), vp); } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_SetPropertyById(JSContext *cx, JSObject *objArg, jsid idArg, HandleValue v) { RootedObject obj(cx, objArg); @@ -3889,7 +3889,7 @@ JS_SetPropertyById(JSContext *cx, JSObject *objArg, jsid idArg, HandleValue v) return JSObject::setGeneric(cx, obj, obj, id, &value, false); } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_SetElement(JSContext *cx, JSObject *objArg, uint32_t index, MutableHandleValue vp) { RootedObject obj(cx, objArg); @@ -3901,7 +3901,7 @@ JS_SetElement(JSContext *cx, JSObject *objArg, uint32_t index, MutableHandleValu return JSObject::setElement(cx, obj, obj, index, vp, false); } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_SetProperty(JSContext *cx, JSObject *objArg, const char *name, HandleValue v) { RootedObject obj(cx, objArg); @@ -3909,7 +3909,7 @@ JS_SetProperty(JSContext *cx, JSObject *objArg, const char *name, HandleValue v) return atom && JS_SetPropertyById(cx, obj, AtomToId(atom), v); } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_SetUCProperty(JSContext *cx, JSObject *objArg, const jschar *name, size_t namelen, HandleValue v) { @@ -3918,7 +3918,7 @@ JS_SetUCProperty(JSContext *cx, JSObject *objArg, const jschar *name, size_t nam return atom && JS_SetPropertyById(cx, obj, AtomToId(atom), v); } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_DeletePropertyById2(JSContext *cx, JSObject *objArg, jsid id, bool *result) { RootedObject obj(cx, objArg); @@ -3929,7 +3929,7 @@ JS_DeletePropertyById2(JSContext *cx, JSObject *objArg, jsid id, bool *result) RootedValue value(cx); - JSBool succeeded; + bool succeeded; if (JSID_IS_SPECIAL(id)) { Rooted sid(cx, JSID_TO_SPECIALID(id)); if (!JSObject::deleteSpecial(cx, obj, sid, &succeeded)) @@ -3943,7 +3943,7 @@ JS_DeletePropertyById2(JSContext *cx, JSObject *objArg, jsid id, bool *result) return true; } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_DeleteElement2(JSContext *cx, JSObject *objArg, uint32_t index, bool *result) { RootedObject obj(cx, objArg); @@ -3952,7 +3952,7 @@ JS_DeleteElement2(JSContext *cx, JSObject *objArg, uint32_t index, bool *result) assertSameCompartment(cx, obj); JSAutoResolveFlags rf(cx, 0); - JSBool succeeded; + bool succeeded; if (!JSObject::deleteElement(cx, obj, index, &succeeded)) return false; @@ -3960,7 +3960,7 @@ JS_DeleteElement2(JSContext *cx, JSObject *objArg, uint32_t index, bool *result) return true; } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_DeleteProperty2(JSContext *cx, JSObject *objArg, const char *name, bool *result) { RootedObject obj(cx, objArg); @@ -3972,7 +3972,7 @@ JS_DeleteProperty2(JSContext *cx, JSObject *objArg, const char *name, bool *resu if (!atom) return false; - JSBool succeeded; + bool succeeded; if (!JSObject::deleteByValue(cx, obj, StringValue(atom), &succeeded)) return false; @@ -3980,7 +3980,7 @@ JS_DeleteProperty2(JSContext *cx, JSObject *objArg, const char *name, bool *resu return true; } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_DeleteUCProperty2(JSContext *cx, JSObject *objArg, const jschar *name, size_t namelen, bool *result) { @@ -3993,7 +3993,7 @@ JS_DeleteUCProperty2(JSContext *cx, JSObject *objArg, const jschar *name, size_t if (!atom) return false; - JSBool succeeded; + bool succeeded; if (!JSObject::deleteByValue(cx, obj, StringValue(atom), &succeeded)) return false; @@ -4001,21 +4001,21 @@ JS_DeleteUCProperty2(JSContext *cx, JSObject *objArg, const jschar *name, size_t return true; } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_DeletePropertyById(JSContext *cx, JSObject *objArg, jsid idArg) { bool junk; return JS_DeletePropertyById2(cx, objArg, idArg, &junk); } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_DeleteElement(JSContext *cx, JSObject *objArg, uint32_t index) { bool junk; return JS_DeleteElement2(cx, objArg, index, &junk); } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_DeleteProperty(JSContext *cx, JSObject *objArg, const char *name) { bool junk; @@ -4195,7 +4195,7 @@ JS_NewPropertyIterator(JSContext *cx, JSObject *objArg) return iterobj; } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_NextProperty(JSContext *cx, JSObject *iterobjArg, jsid *idp) { RootedObject iterobj(cx, iterobjArg); @@ -4275,7 +4275,7 @@ JS_NewArrayObject(JSContext *cx, int length, jsval *vector) return NewDenseCopiedArray(cx, (uint32_t)length, vector); } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_IsArrayObject(JSContext *cx, JSObject *objArg) { RootedObject obj(cx, objArg); @@ -4283,7 +4283,7 @@ JS_IsArrayObject(JSContext *cx, JSObject *objArg) return ObjectClassIs(obj, ESClass_Array, cx); } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_GetArrayLength(JSContext *cx, JSObject *objArg, uint32_t *lengthp) { RootedObject obj(cx, objArg); @@ -4293,7 +4293,7 @@ JS_GetArrayLength(JSContext *cx, JSObject *objArg, uint32_t *lengthp) return GetLengthProperty(cx, obj, lengthp); } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_SetArrayLength(JSContext *cx, JSObject *objArg, uint32_t length) { RootedObject obj(cx, objArg); @@ -4303,7 +4303,7 @@ JS_SetArrayLength(JSContext *cx, JSObject *objArg, uint32_t length) return SetLengthProperty(cx, obj, length); } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_CheckAccess(JSContext *cx, JSObject *objArg, jsid idArg, JSAccessMode mode, jsval *vp, unsigned *attrsp) { @@ -4314,7 +4314,7 @@ JS_CheckAccess(JSContext *cx, JSObject *objArg, jsid idArg, JSAccessMode mode, AssertHeapIsIdle(cx); CHECK_REQUEST(cx); assertSameCompartment(cx, obj, id); - JSBool status = CheckAccess(cx, obj, id, mode, &value, attrsp); + bool status = CheckAccess(cx, obj, id, mode, &value, attrsp); *vp = value; return status; } @@ -4471,19 +4471,19 @@ JS_GetFunctionArity(JSFunction *fun) return fun->nargs; } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_ObjectIsFunction(JSContext *cx, JSObject *obj) { return obj->is(); } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_ObjectIsCallable(JSContext *cx, JSObject *obj) { return obj->isCallable(); } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_IsNativeFunction(JSObject *funobj, JSNative call) { if (!funobj->is()) @@ -4492,7 +4492,7 @@ JS_IsNativeFunction(JSObject *funobj, JSNative call) return fun->isNative() && fun->native() == call; } -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_IsConstructor(JSFunction *fun) { return fun->isNativeConstructor() || fun->isInterpretedConstructor(); @@ -4534,7 +4534,7 @@ js_generic_native_method_dispatcher(JSContext *cx, unsigned argc, Value *vp) return fs->call.op(cx, argc, vp); } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_DefineFunctions(JSContext *cx, JSObject *objArg, const JSFunctionSpec *fs) { JS_THREADSAFE_ASSERT(cx->compartment() != cx->runtime()->atomsCompartment); @@ -4913,11 +4913,11 @@ JS_CompileScript(JSContext *cx, JSObject *objArg, const char *ascii, size_t leng return Compile(cx, obj, options, ascii, length); } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_BufferIsCompilableUnit(JSContext *cx, JSObject *objArg, const char *utf8, size_t length) { RootedObject obj(cx, objArg); - JSBool result; + bool result; JSExceptionState *exnState; JSErrorReporter older; @@ -5105,7 +5105,7 @@ JS_DecompileFunctionBody(JSContext *cx, JSFunction *funArg, unsigned indent) return FunctionToString(cx, fun, true, !(indent & JS_DONT_PRETTY_PRINT)); } -JS_NEVER_INLINE JS_PUBLIC_API(JSBool) +JS_NEVER_INLINE JS_PUBLIC_API(bool) JS_ExecuteScript(JSContext *cx, JSObject *objArg, JSScript *scriptArg, jsval *rval) { RootedObject obj(cx, objArg); @@ -5138,7 +5138,7 @@ JS_ExecuteScript(JSContext *cx, JSObject *objArg, JSScript *scriptArg, jsval *rv return Execute(cx, script, *obj, rval); } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_ExecuteScriptVersion(JSContext *cx, JSObject *objArg, JSScript *script, jsval *rval, JSVersion version) { @@ -5221,7 +5221,7 @@ JS::Evaluate(JSContext *cx, HandleObject obj, CompileOptions options, return Evaluate(cx, obj, options, buffer.begin(), buffer.length(), rval); } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_EvaluateUCScriptForPrincipals(JSContext *cx, JSObject *objArg, JSPrincipals *principals, const jschar *chars, unsigned length, @@ -5236,7 +5236,7 @@ JS_EvaluateUCScriptForPrincipals(JSContext *cx, JSObject *objArg, return Evaluate(cx, obj, options, chars, length, rval); } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_EvaluateUCScriptForPrincipalsVersion(JSContext *cx, JSObject *objArg, JSPrincipals *principals, const jschar *chars, unsigned length, @@ -5252,7 +5252,7 @@ JS_EvaluateUCScriptForPrincipalsVersion(JSContext *cx, JSObject *objArg, return Evaluate(cx, obj, options, chars, length, rval); } -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_EvaluateUCScriptForPrincipalsVersionOrigin(JSContext *cx, JSObject *objArg, JSPrincipals *principals, JSPrincipals *originPrincipals, @@ -5270,7 +5270,7 @@ JS_EvaluateUCScriptForPrincipalsVersionOrigin(JSContext *cx, JSObject *objArg, return Evaluate(cx, obj, options, chars, length, rval); } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_EvaluateUCScript(JSContext *cx, JSObject *objArg, const jschar *chars, unsigned length, const char *filename, unsigned lineno, jsval *rval) { @@ -5282,7 +5282,7 @@ JS_EvaluateUCScript(JSContext *cx, JSObject *objArg, const jschar *chars, unsign } /* Ancient unsigned nbytes is part of API/ABI, so use size_t length local. */ -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_EvaluateScriptForPrincipals(JSContext *cx, JSObject *objArg, JSPrincipals *principals, const char *bytes, unsigned nbytes, const char *filename, unsigned lineno, jsval *rval) @@ -5295,7 +5295,7 @@ JS_EvaluateScriptForPrincipals(JSContext *cx, JSObject *objArg, JSPrincipals *pr return Evaluate(cx, obj, options, bytes, nbytes, rval); } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_EvaluateScriptForPrincipalsVersion(JSContext *cx, JSObject *objArg, JSPrincipals *principals, const char *bytes, unsigned nbytes, const char *filename, unsigned lineno, jsval *rval, @@ -5310,7 +5310,7 @@ JS_EvaluateScriptForPrincipalsVersion(JSContext *cx, JSObject *objArg, JSPrincip return Evaluate(cx, obj, options, bytes, nbytes, rval); } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_EvaluateScript(JSContext *cx, JSObject *objArg, const char *bytes, unsigned nbytes, const char *filename, unsigned lineno, jsval *rval) { @@ -5321,7 +5321,7 @@ JS_EvaluateScript(JSContext *cx, JSObject *objArg, const char *bytes, unsigned n return Evaluate(cx, obj, options, bytes, nbytes, rval); } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_CallFunction(JSContext *cx, JSObject *objArg, JSFunction *fun, unsigned argc, jsval *argv, jsval *rval) { @@ -5339,7 +5339,7 @@ JS_CallFunction(JSContext *cx, JSObject *objArg, JSFunction *fun, unsigned argc, return true; } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_CallFunctionName(JSContext *cx, JSObject *objArg, const char *name, unsigned argc, jsval *argv, jsval *rval) { @@ -5366,7 +5366,7 @@ JS_CallFunctionName(JSContext *cx, JSObject *objArg, const char *name, unsigned return true; } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_CallFunctionValue(JSContext *cx, JSObject *objArg, jsval fval, unsigned argc, jsval *argv, jsval *rval) { @@ -5456,13 +5456,13 @@ JS_TriggerOperationCallback(JSRuntime *rt) rt->triggerOperationCallback(); } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_IsRunning(JSContext *cx) { return cx->currentlyRunning(); } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_SaveFrameChain(JSContext *cx) { AssertHeapIsIdleOrIterating(cx); @@ -5522,7 +5522,7 @@ JS_NewStringCopyZ(JSContext *cx, const char *s) return str; } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_StringHasBeenInterned(JSContext *cx, JSString *str) { AssertHeapIsIdle(cx); @@ -5695,7 +5695,7 @@ JS_GetFlatStringChars(JSFlatString *str) return str->chars(); } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_CompareStrings(JSContext *cx, JSString *str1, JSString *str2, int32_t *result) { AssertHeapIsIdle(cx); @@ -5704,8 +5704,8 @@ JS_CompareStrings(JSContext *cx, JSString *str1, JSString *str2, int32_t *result return CompareStrings(cx, str1, str2, result); } -JS_PUBLIC_API(JSBool) -JS_StringEqualsAscii(JSContext *cx, JSString *str, const char *asciiBytes, JSBool *match) +JS_PUBLIC_API(bool) +JS_StringEqualsAscii(JSContext *cx, JSString *str, const char *asciiBytes, bool *match) { AssertHeapIsIdle(cx); CHECK_REQUEST(cx); @@ -5717,7 +5717,7 @@ JS_StringEqualsAscii(JSContext *cx, JSString *str, const char *asciiBytes, JSBoo return true; } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_FlatStringEqualsAscii(JSFlatString *str, const char *asciiBytes) { return StringEqualsAscii(str, asciiBytes); @@ -5739,7 +5739,7 @@ JS_PutEscapedString(JSContext *cx, char *buffer, size_t size, JSString *str, cha return PutEscapedString(buffer, size, linearStr, quote); } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_FileEscapedString(FILE *fp, JSString *str, char quote) { JSLinearString *linearStr = str->ensureLinear(NULL); @@ -5772,7 +5772,7 @@ JS_ConcatStrings(JSContext *cx, JSString *left, JSString *right) return ConcatStrings(cx, lstr, rstr); } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_DecodeBytes(JSContext *cx, const char *src, size_t srclen, jschar *dst, size_t *dstlenp) { AssertHeapIsIdle(cx); @@ -5845,7 +5845,7 @@ JS_EncodeStringToBuffer(JSContext *cx, JSString *str, char *buffer, size_t lengt return necessaryLength; } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_Stringify(JSContext *cx, jsval *vp, JSObject *replacerArg, jsval space, JSONWriteCallback callback, void *data) { @@ -5866,7 +5866,7 @@ JS_Stringify(JSContext *cx, jsval *vp, JSObject *replacerArg, jsval space, return callback(sb.begin(), sb.length(), data); } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_ParseJSON(JSContext *cx, const jschar *chars, uint32_t len, JS::MutableHandleValue vp) { AssertHeapIsIdle(cx); @@ -5876,7 +5876,7 @@ JS_ParseJSON(JSContext *cx, const jschar *chars, uint32_t len, JS::MutableHandle return ParseJSONWithReviver(cx, JS::StableCharPtr(chars, len), len, reviver, vp); } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_ParseJSONWithReviver(JSContext *cx, const jschar *chars, uint32_t len, jsval reviverArg, jsval *vp) { AssertHeapIsIdle(cx); @@ -5890,7 +5890,7 @@ JS_ParseJSONWithReviver(JSContext *cx, const jschar *chars, uint32_t len, jsval return true; } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_ReadStructuredClone(JSContext *cx, uint64_t *buf, size_t nbytes, uint32_t version, jsval *vp, const JSStructuredCloneCallbacks *optionalCallbacks, @@ -5910,7 +5910,7 @@ JS_ReadStructuredClone(JSContext *cx, uint64_t *buf, size_t nbytes, return ReadStructuredClone(cx, buf, nbytes, vp, callbacks, closure); } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_WriteStructuredClone(JSContext *cx, jsval valueArg, uint64_t **bufp, size_t *nbytesp, const JSStructuredCloneCallbacks *optionalCallbacks, void *closure, jsval transferable) @@ -5928,15 +5928,15 @@ JS_WriteStructuredClone(JSContext *cx, jsval valueArg, uint64_t **bufp, size_t * callbacks, closure, transferable); } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_ClearStructuredClone(const uint64_t *data, size_t nbytes) { return ClearStructuredClone(data, nbytes); } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_StructuredCloneHasTransferables(const uint64_t *data, size_t nbytes, - JSBool *hasTransferable) + bool *hasTransferable) { bool transferable; if (!StructuredCloneHasTransferObjects(data, nbytes, &transferable)) @@ -5946,7 +5946,7 @@ JS_StructuredCloneHasTransferables(const uint64_t *data, size_t nbytes, return true; } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_StructuredClone(JSContext *cx, jsval valueArg, jsval *vp, const JSStructuredCloneCallbacks *optionalCallbacks, void *closure) @@ -6080,25 +6080,25 @@ JS_SetStructuredCloneCallbacks(JSRuntime *rt, const JSStructuredCloneCallbacks * rt->structuredCloneCallbacks = callbacks; } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_ReadUint32Pair(JSStructuredCloneReader *r, uint32_t *p1, uint32_t *p2) { return r->input().readPair((uint32_t *) p1, (uint32_t *) p2); } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_ReadBytes(JSStructuredCloneReader *r, void *p, size_t len) { return r->input().readBytes(p, len); } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_WriteUint32Pair(JSStructuredCloneWriter *w, uint32_t tag, uint32_t data) { return w->output().writePair(tag, data); } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_WriteBytes(JSStructuredCloneWriter *w, const void *p, size_t len) { return w->output().writeBytes(p, len); @@ -6160,11 +6160,11 @@ JS_ReportErrorNumberUCArray(JSContext *cx, JSErrorCallback errorCallback, errorNumber, args); } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_ReportWarning(JSContext *cx, const char *format, ...) { va_list ap; - JSBool ok; + bool ok; AssertHeapIsIdle(cx); va_start(ap, format); @@ -6173,13 +6173,13 @@ JS_ReportWarning(JSContext *cx, const char *format, ...) return ok; } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_ReportErrorFlagsAndNumber(JSContext *cx, unsigned flags, JSErrorCallback errorCallback, void *userRef, const unsigned errorNumber, ...) { va_list ap; - JSBool ok; + bool ok; AssertHeapIsIdle(cx); va_start(ap, errorNumber); @@ -6189,13 +6189,13 @@ JS_ReportErrorFlagsAndNumber(JSContext *cx, unsigned flags, return ok; } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_ReportErrorFlagsAndNumberUC(JSContext *cx, unsigned flags, JSErrorCallback errorCallback, void *userRef, const unsigned errorNumber, ...) { va_list ap; - JSBool ok; + bool ok; AssertHeapIsIdle(cx); va_start(ap, errorNumber); @@ -6254,7 +6254,7 @@ JS_NewDateObjectMsec(JSContext *cx, double msec) return js_NewDateObjectMsec(cx, msec); } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_ObjectIsDate(JSContext *cx, JSObject *objArg) { RootedObject obj(cx, objArg); @@ -6304,7 +6304,7 @@ JS_NewUCRegExpObject(JSContext *cx, JSObject *objArg, jschar *chars, size_t leng } JS_PUBLIC_API(void) -JS_SetRegExpInput(JSContext *cx, JSObject *objArg, JSString *input, JSBool multiline) +JS_SetRegExpInput(JSContext *cx, JSObject *objArg, JSString *input, bool multiline) { RootedObject obj(cx, objArg); AssertHeapIsIdle(cx); @@ -6325,9 +6325,9 @@ JS_ClearRegExpStatics(JSContext *cx, JSObject *objArg) obj->as().getRegExpStatics()->clear(); } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_ExecuteRegExp(JSContext *cx, JSObject *objArg, JSObject *reobjArg, jschar *chars, size_t length, - size_t *indexp, JSBool test, jsval *rval) + size_t *indexp, bool test, jsval *rval) { RootedObject obj(cx, objArg); RootedObject reobj(cx, reobjArg); @@ -6369,9 +6369,9 @@ JS_NewUCRegExpObjectNoStatics(JSContext *cx, jschar *chars, size_t length, unsig RegExpFlag(flags), NULL); } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_ExecuteRegExpNoStatics(JSContext *cx, JSObject *objArg, jschar *chars, size_t length, - size_t *indexp, JSBool test, jsval *rval) + size_t *indexp, bool test, jsval *rval) { RootedObject obj(cx, objArg); AssertHeapIsIdle(cx); @@ -6387,7 +6387,7 @@ JS_ExecuteRegExpNoStatics(JSContext *cx, JSObject *objArg, jschar *chars, size_t return true; } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_ObjectIsRegExp(JSContext *cx, JSObject *objArg) { RootedObject obj(cx, objArg); @@ -6417,7 +6417,7 @@ JS_GetRegExpSource(JSContext *cx, JSObject *objArg) /************************************************************************/ -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_SetDefaultLocale(JSRuntime *rt, const char *locale) { AssertHeapIsIdle(rt); @@ -6447,14 +6447,14 @@ JS_GetLocaleCallbacks(JSRuntime *rt) /************************************************************************/ -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_IsExceptionPending(JSContext *cx) { /* This function can be called by a finalizer. */ - return (JSBool) cx->isExceptionPending(); + return (bool) cx->isExceptionPending(); } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_GetPendingException(JSContext *cx, jsval *vp) { AssertHeapIsIdle(cx); @@ -6483,7 +6483,7 @@ JS_ClearPendingException(JSContext *cx) cx->clearPendingException(); } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_ReportPendingException(JSContext *cx) { AssertHeapIsIdle(cx); @@ -6551,7 +6551,7 @@ JS_ErrorFromException(JSContext *cx, jsval valueArg) return js_ErrorFromException(value); } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_ThrowReportedError(JSContext *cx, const char *message, JSErrorReport *reportp) { @@ -6560,7 +6560,7 @@ JS_ThrowReportedError(JSContext *cx, const char *message, js_ErrorToException(cx, message, reportp, NULL, NULL); } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_ThrowStopIteration(JSContext *cx) { AssertHeapIsIdle(cx); @@ -6671,7 +6671,7 @@ BOOL WINAPI DllMain (HINSTANCE hDLL, DWORD dwReason, LPVOID lpReserved) #endif -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_IndexToId(JSContext *cx, uint32_t index, jsid *idp) { RootedId id(cx); @@ -6681,7 +6681,7 @@ JS_IndexToId(JSContext *cx, uint32_t index, jsid *idp) return true; } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_CharsToId(JSContext* cx, JS::TwoByteChars chars, jsid *idp) { RootedAtom atom(cx, AtomizeChars(cx, chars.start().get(), chars.length())); @@ -6695,8 +6695,8 @@ JS_CharsToId(JSContext* cx, JS::TwoByteChars chars, jsid *idp) return true; } -JS_PUBLIC_API(JSBool) -JS_IsIdentifier(JSContext *cx, JSString *str, JSBool *isIdentifier) +JS_PUBLIC_API(bool) +JS_IsIdentifier(JSContext *cx, JSString *str, bool *isIdentifier) { assertSameCompartment(cx, str); @@ -6708,7 +6708,7 @@ JS_IsIdentifier(JSContext *cx, JSString *str, JSBool *isIdentifier) return true; } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_DescribeScriptedCaller(JSContext *cx, JSScript **script, unsigned *lineno) { if (script) @@ -6736,7 +6736,7 @@ CallOnce(void *func) } #endif -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_CallOnce(JSCallOnceType *once, JSInitCallback func) { #ifdef JS_THREADSAFE @@ -6830,7 +6830,7 @@ JS_GetScriptedGlobal(JSContext *cx) return &i.scopeChain()->global(); } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_PreventExtensions(JSContext *cx, JS::HandleObject obj) { bool extensible; diff --git a/js/src/jsapi.h b/js/src/jsapi.h index 083b7e4247ea5..a53aee2adb49c 100644 --- a/js/src/jsapi.h +++ b/js/src/jsapi.h @@ -702,7 +702,7 @@ CallMethodIfWrapped(JSContext *cx, IsAcceptableThis test, NativeImpl impl, CallA * Now to implement the actual method, write a JSNative that calls the method * declared below, passing the appropriate template and runtime arguments. * - * static JSBool + * static bool * answer_getAnswer(JSContext *cx, unsigned argc, JS::Value *vp) * { * JS::CallArgs args = JS::CallArgsFromVp(argc, vp); @@ -756,7 +756,7 @@ CallNonGenericMethod(JSContext *cx, IsAcceptableThis Test, NativeImpl Impl, Call * be a string (Unicode property identifier) or an int (element index). The * *vp out parameter, on success, is the new property value after the action. */ -typedef JSBool +typedef bool (* JSPropertyOp)(JSContext *cx, JS::Handle obj, JS::Handle id, JS::MutableHandle vp); @@ -767,9 +767,9 @@ typedef JSBool * parameter, on success, is the new property value after the * set. */ -typedef JSBool +typedef bool (* JSStrictPropertyOp)(JSContext *cx, JS::Handle obj, JS::Handle id, - JSBool strict, JS::MutableHandle vp); + bool strict, JS::MutableHandle vp); /* * Delete a property named by id in obj. @@ -786,9 +786,9 @@ typedef JSBool * property, or an inherited property, is allowed -- it's just pointless), * set *succeeded to true and return true. */ -typedef JSBool +typedef bool (* JSDeletePropertyOp)(JSContext *cx, JS::Handle obj, JS::Handle id, - JSBool *succeeded); + bool *succeeded); /* * This function type is used for callbacks that enumerate the properties of @@ -822,7 +822,7 @@ typedef JSBool * The return value is used to indicate success, with a value of false * indicating failure. */ -typedef JSBool +typedef bool (* JSNewEnumerateOp)(JSContext *cx, JS::Handle obj, JSIterateOp enum_op, JS::MutableHandle statep, JS::MutableHandle idp); @@ -830,7 +830,7 @@ typedef JSBool * The old-style JSClass.enumerate op should define all lazy properties not * yet reflected in obj. */ -typedef JSBool +typedef bool (* JSEnumerateOp)(JSContext *cx, JS::Handle obj); /* @@ -845,7 +845,7 @@ typedef JSBool * * NB: JSNewResolveOp provides a cheaper way to resolve lazy properties. */ -typedef JSBool +typedef bool (* JSResolveOp)(JSContext *cx, JS::Handle obj, JS::Handle id); /* @@ -860,7 +860,7 @@ typedef JSBool * This hook instead of JSResolveOp is called via the JSClass.resolve member * if JSCLASS_NEW_RESOLVE is set in JSClass.flags. */ -typedef JSBool +typedef bool (* JSNewResolveOp)(JSContext *cx, JS::Handle obj, JS::Handle id, unsigned flags, JS::MutableHandle objp); @@ -868,7 +868,7 @@ typedef JSBool * Convert obj to the given type, returning true with the resulting value in * *vp on success, and returning false on error or exception. */ -typedef JSBool +typedef bool (* JSConvertOp)(JSContext *cx, JS::Handle obj, JSType type, JS::MutableHandle vp); @@ -911,7 +911,7 @@ struct JSStringFinalizer { * value in *vp, and its attributes in *attrsp. As for JSPropertyOp above, id * is either a string or an int jsval. */ -typedef JSBool +typedef bool (* JSCheckAccessOp)(JSContext *cx, JS::Handle obj, JS::Handle id, JSAccessMode mode, JS::MutableHandle vp); @@ -920,9 +920,9 @@ typedef JSBool * true on success with true in *bp if v is an instance of obj, false in * *bp otherwise. */ -typedef JSBool +typedef bool (* JSHasInstanceOp)(JSContext *cx, JS::Handle obj, JS::MutableHandle vp, - JSBool *bp); + bool *bp); /* * Function type for trace operation of the class called to enumerate all @@ -971,7 +971,7 @@ typedef enum JSContextOp { * Any other value For future compatibility the callback must do nothing * and return true in this case. */ -typedef JSBool +typedef bool (* JSContextCallback)(JSContext *cx, unsigned contextOp, void *data); typedef enum JSGCStatus { @@ -1005,7 +1005,7 @@ typedef enum JSFinalizeStatus { } JSFinalizeStatus; typedef void -(* JSFinalizeCallback)(JSFreeOp *fop, JSFinalizeStatus status, JSBool isCompartment); +(* JSFinalizeCallback)(JSFreeOp *fop, JSFinalizeStatus status, bool isCompartment); /* * Generic trace operation that calls JS_CallTracer on each traceable thing @@ -1014,7 +1014,7 @@ typedef void typedef void (* JSTraceDataOp)(JSTracer *trc, void *data); -typedef JSBool +typedef bool (* JSOperationCallback)(JSContext *cx); typedef void @@ -1061,19 +1061,19 @@ typedef const JSErrorFormatString * (* JSErrorCallback)(void *userRef, const char *locale, const unsigned errorNumber); -typedef JSBool +typedef bool (* JSLocaleToUpperCase)(JSContext *cx, JS::Handle src, JS::MutableHandle rval); -typedef JSBool +typedef bool (* JSLocaleToLowerCase)(JSContext *cx, JS::Handle src, JS::MutableHandle rval); -typedef JSBool +typedef bool (* JSLocaleCompare)(JSContext *cx, JS::Handle src1, JS::Handle src2, JS::MutableHandle rval); -typedef JSBool +typedef bool (* JSLocaleToUnicode)(JSContext *cx, const char *src, JS::MutableHandle rval); /* @@ -1087,7 +1087,7 @@ typedef void * Used to check if a CSP instance wants to disable eval() and friends. * See js_CheckCSPPermitsJSAction() in jsobj. */ -typedef JSBool +typedef bool (* JSCSPEvalChecker)(JSContext *cx); /* @@ -1156,7 +1156,7 @@ typedef JSObject *(*ReadStructuredCloneOp)(JSContext *cx, JSStructuredCloneReade * * Return true on success, false on error/exception. */ -typedef JSBool (*WriteStructuredCloneOp)(JSContext *cx, JSStructuredCloneWriter *w, +typedef bool (*WriteStructuredCloneOp)(JSContext *cx, JSStructuredCloneWriter *w, JS::Handle obj, void *closure); /* @@ -1215,7 +1215,7 @@ JS_NumberValue(double d) */ #define id iden -static JS_ALWAYS_INLINE JSBool +static JS_ALWAYS_INLINE bool JSID_IS_STRING(jsid id) { return (JSID_BITS(id) & JSID_TYPE_MASK) == 0; @@ -1228,13 +1228,13 @@ JSID_TO_STRING(jsid id) return (JSString *)JSID_BITS(id); } -static JS_ALWAYS_INLINE JSBool +static JS_ALWAYS_INLINE bool JSID_IS_ZERO(jsid id) { return JSID_BITS(id) == 0; } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_StringHasBeenInterned(JSContext *cx, JSString *str); /* @@ -1247,7 +1247,7 @@ JS_StringHasBeenInterned(JSContext *cx, JSString *str); JS_PUBLIC_API(jsid) INTERNED_STRING_TO_JSID(JSContext *cx, JSString *str); -static JS_ALWAYS_INLINE JSBool +static JS_ALWAYS_INLINE bool JSID_IS_INT(jsid id) { return !!(JSID_BITS(id) & JSID_TYPE_INT); @@ -1263,7 +1263,7 @@ JSID_TO_INT(jsid id) #define JSID_INT_MIN 0 #define JSID_INT_MAX INT32_MAX -static JS_ALWAYS_INLINE JSBool +static JS_ALWAYS_INLINE bool INT_FITS_IN_JSID(int32_t i) { return i >= 0; @@ -1278,7 +1278,7 @@ INT_TO_JSID(int32_t i) return id; } -static JS_ALWAYS_INLINE JSBool +static JS_ALWAYS_INLINE bool JSID_IS_OBJECT(jsid id) { return (JSID_BITS(id) & JSID_TYPE_MASK) == JSID_TYPE_OBJECT && @@ -1302,7 +1302,7 @@ OBJECT_TO_JSID(JSObject *obj) return id; } -static JS_ALWAYS_INLINE JSBool +static JS_ALWAYS_INLINE bool JSID_IS_GCTHING(jsid id) { return JSID_IS_STRING(id) || JSID_IS_OBJECT(id); @@ -1321,7 +1321,7 @@ JSID_TO_GCTHING(jsid id) * hooks receiving a jsid except when explicitly noted in the API contract. */ -static JS_ALWAYS_INLINE JSBool +static JS_ALWAYS_INLINE bool JSID_IS_VOID(const jsid id) { JS_ASSERT_IF(((size_t)JSID_BITS(id) & JSID_TYPE_MASK) == JSID_TYPE_VOID, @@ -1329,7 +1329,7 @@ JSID_IS_VOID(const jsid id) return ((size_t)JSID_BITS(id) == JSID_TYPE_VOID); } -static JS_ALWAYS_INLINE JSBool +static JS_ALWAYS_INLINE bool JSID_IS_EMPTY(const jsid id) { return ((size_t)JSID_BITS(id) == JSID_TYPE_OBJECT); @@ -1349,7 +1349,7 @@ extern JS_PUBLIC_DATA(const jsid) JSID_EMPTY; * Returns true iff the given jsval is immune to GC and can be used across * multiple JSRuntimes without requiring any conversion API. */ -static JS_ALWAYS_INLINE JSBool +static JS_ALWAYS_INLINE bool JSVAL_IS_UNIVERSAL(jsval v) { return !JSVAL_IS_GCTHING(v); @@ -1435,7 +1435,7 @@ class AutoIdRooter : private AutoGCRooter * Equivalently: each distinct JSCallOnceType object will allow one JS_CallOnce * to invoke its JSInitCallback. */ -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_CallOnce(JSCallOnceType *once, JSInitCallback func); /* Microseconds since the epoch, midnight, January 1, 1970 UTC. */ @@ -1462,7 +1462,7 @@ JS_GetEmptyString(JSRuntime *rt); * Format is a string of the following characters (spaces are insignificant), * specifying the tabulated type conversions: * - * b JSBool Boolean + * b bool Boolean * c uint16_t/jschar ECMA uint16_t, Unicode char * i int32_t ECMA int32_t * u uint32_t ECMA uint32_t @@ -1490,20 +1490,20 @@ JS_GetEmptyString(JSRuntime *rt); * may be passed without error; it is up to the caller to deal with trailing * unconverted arguments. */ -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_ConvertArguments(JSContext *cx, unsigned argc, jsval *argv, const char *format, ...); #ifdef va_start -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_ConvertArgumentsVA(JSContext *cx, unsigned argc, jsval *argv, const char *format, va_list ap); #endif -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_ConvertValue(JSContext *cx, jsval v, JSType type, jsval *vp); -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_ValueToObject(JSContext *cx, jsval v, JSObject **objp); extern JS_PUBLIC_API(JSFunction *) @@ -1518,7 +1518,7 @@ JS_ValueToString(JSContext *cx, jsval v); extern JS_PUBLIC_API(JSString *) JS_ValueToSource(JSContext *cx, jsval v); -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_ValueToNumber(JSContext *cx, jsval v, double *dp); namespace js { @@ -1574,7 +1574,7 @@ ToBoolean(const Value &v) } /* namespace JS */ -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_DoubleIsInt32(double d, int32_t *ip); extern JS_PUBLIC_API(int32_t) @@ -1587,21 +1587,21 @@ JS_DoubleToUint32(double d); * Convert a value to a number, then to an int32_t, according to the ECMA rules * for ToInt32. */ -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_ValueToECMAInt32(JSContext *cx, jsval v, int32_t *ip); /* * Convert a value to a number, then to an int64_t, according to the WebIDL * rules for ToInt64: http://dev.w3.org/2006/webapi/WebIDL/#es-long-long */ -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_ValueToInt64(JSContext *cx, jsval v, int64_t *ip); /* * Convert a value to a number, then to an uint64_t, according to the WebIDL * rules for ToUint64: http://dev.w3.org/2006/webapi/WebIDL/#es-unsigned-long-long */ -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_ValueToUint64(JSContext *cx, jsval v, uint64_t *ip); namespace js { @@ -1703,7 +1703,7 @@ ToUint64(JSContext *cx, JS::Handle v, uint64_t *out) * Convert a value to a number, then to a uint32_t, according to the ECMA rules * for ToUint32. */ -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_ValueToECMAUint32(JSContext *cx, jsval v, uint32_t *ip); /* @@ -1711,17 +1711,17 @@ JS_ValueToECMAUint32(JSContext *cx, jsval v, uint32_t *ip); * nearest; but failing with an error report if the double is out of range * or unordered. */ -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_ValueToInt32(JSContext *cx, jsval v, int32_t *ip); /* * ECMA ToUint16, for mapping a jsval to a Unicode point. */ -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_ValueToUint16(JSContext *cx, jsval v, uint16_t *ip); -extern JS_PUBLIC_API(JSBool) -JS_ValueToBoolean(JSContext *cx, jsval v, JSBool *bp); +extern JS_PUBLIC_API(bool) +JS_ValueToBoolean(JSContext *cx, jsval v, bool *bp); extern JS_PUBLIC_API(JSType) JS_TypeOfValue(JSContext *cx, jsval v); @@ -1729,21 +1729,21 @@ JS_TypeOfValue(JSContext *cx, jsval v); extern JS_PUBLIC_API(const char *) JS_GetTypeName(JSContext *cx, JSType type); -extern JS_PUBLIC_API(JSBool) -JS_StrictlyEqual(JSContext *cx, jsval v1, jsval v2, JSBool *equal); +extern JS_PUBLIC_API(bool) +JS_StrictlyEqual(JSContext *cx, jsval v1, jsval v2, bool *equal); -extern JS_PUBLIC_API(JSBool) -JS_LooselyEqual(JSContext *cx, jsval v1, jsval v2, JSBool *equal); +extern JS_PUBLIC_API(bool) +JS_LooselyEqual(JSContext *cx, jsval v1, jsval v2, bool *equal); -extern JS_PUBLIC_API(JSBool) -JS_SameValue(JSContext *cx, jsval v1, jsval v2, JSBool *same); +extern JS_PUBLIC_API(bool) +JS_SameValue(JSContext *cx, jsval v1, jsval v2, bool *same); /* True iff fun is the global eval function. */ -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_IsBuiltinEvalFunction(JSFunction *fun); /* True iff fun is the Function constructor. */ -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_IsBuiltinFunctionConstructor(JSFunction *fun); /************************************************************************/ @@ -1775,7 +1775,7 @@ typedef enum JSUseHelperThreads * is, calling JS_Init/JSAPI methods/JS_ShutDown in that order, then doing so * again). This restriction may eventually be lifted. */ -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_Init(void); /** @@ -1831,7 +1831,7 @@ JS_BeginRequest(JSContext *cx); extern JS_PUBLIC_API(void) JS_EndRequest(JSContext *cx); -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_IsInRequest(JSRuntime *rt); namespace JS { @@ -2038,7 +2038,7 @@ extern JS_PUBLIC_API(uint32_t) JS_ToggleOptions(JSContext *cx, uint32_t options); extern JS_PUBLIC_API(void) -JS_SetJitHardening(JSRuntime *rt, JSBool enabled); +JS_SetJitHardening(JSRuntime *rt, bool enabled); extern JS_PUBLIC_API(const char *) JS_GetImplementationVersion(void); @@ -2061,13 +2061,13 @@ JS_SetCompartmentPrivate(JSCompartment *compartment, void *data); extern JS_PUBLIC_API(void *) JS_GetCompartmentPrivate(JSCompartment *compartment); -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_WrapObject(JSContext *cx, JSObject **objp); -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_WrapValue(JSContext *cx, jsval *vp); -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_WrapId(JSContext *cx, jsid *idp); extern JS_PUBLIC_API(JSObject *) @@ -2080,7 +2080,7 @@ js_TransplantObjectWithWrapper(JSContext *cx, JS::Handle targetobj, JS::Handle targetwrapper); -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_RefreshCrossCompartmentWrappers(JSContext *cx, JSObject *ob); /* @@ -2153,7 +2153,7 @@ JS_IterateCompartments(JSRuntime *rt, void *data, * * NB: This sets cx's global object to obj if it was null. */ -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_InitStandardClasses(JSContext *cx, JSObject *obj); /* @@ -2162,24 +2162,24 @@ JS_InitStandardClasses(JSContext *cx, JSObject *obj); * prototype and storing true in *resolved. If id does not name a standard * class or a top-level property induced by initializing a standard class, * store false in *resolved and just return true. Return false on error, - * as usual for JSBool result-typed API entry points. + * as usual for bool result-typed API entry points. * * This API can be called directly from a global object class's resolve op, * to define standard classes lazily. The class's enumerate op should call * JS_EnumerateStandardClasses(cx, obj), to define eagerly during for..in * loops any classes not yet resolved lazily. */ -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_ResolveStandardClass(JSContext *cx, JS::Handle obj, JS::Handle id, - JSBool *resolved); + bool *resolved); -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_EnumerateStandardClasses(JSContext *cx, JS::Handle obj); -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_GetClassObject(JSContext *cx, JSObject *obj, JSProtoKey key, JSObject **objp); -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_GetClassPrototype(JSContext *cx, JSProtoKey key, JSObject **objp); extern JS_PUBLIC_API(JSProtoKey) @@ -2209,7 +2209,7 @@ JS_GetArrayPrototype(JSContext *cx, JSObject *forObj); extern JS_PUBLIC_API(JSObject *) JS_GetGlobalForObject(JSContext *cx, JSObject *obj); -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_IsGlobalObject(JSObject *obj); /* @@ -2249,7 +2249,7 @@ JS_InitReflect(JSContext *cx, JSObject *global); * Initialize the 'ctypes' object on a global variable 'obj'. The 'ctypes' * object will be sealed. */ -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_InitCTypesClass(JSContext *cx, JSObject *global); /* @@ -2281,7 +2281,7 @@ extern JS_PUBLIC_API(void) JS_SetCTypesCallbacks(JSObject *ctypesObj, JSCTypesCallbacks *callbacks); #endif -typedef JSBool +typedef bool (* JSEnumerateDiagnosticMemoryCallback)(void *ptr, size_t length); /* @@ -2351,13 +2351,13 @@ JS_strdup(JSRuntime *rt, const char *s); * debugging if you should fail to do JS_Remove*Root(cx, &structPtr->memberObj) * before freeing structPtr's memory. */ -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_AddValueRoot(JSContext *cx, jsval *vp); -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_AddStringRoot(JSContext *cx, JSString **rp); -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_AddObjectRoot(JSContext *cx, JSObject **rp); #ifdef NAME_ALL_GC_ROOTS @@ -2368,19 +2368,19 @@ JS_AddObjectRoot(JSContext *cx, JSObject **rp); #define JS_AddObjectRoot(cx,rp) JS_AddNamedObjectRoot((cx), (rp), (__FILE__ ":" JS_TOKEN_TO_STRING(__LINE__)) #endif -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_AddNamedValueRoot(JSContext *cx, jsval *vp, const char *name); -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_AddNamedValueRootRT(JSRuntime *rt, jsval *vp, const char *name); -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_AddNamedStringRoot(JSContext *cx, JSString **rp, const char *name); -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_AddNamedObjectRoot(JSContext *cx, JSObject **rp, const char *name); -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_AddNamedScriptRoot(JSContext *cx, JSScript **rp, const char *name); extern JS_PUBLIC_API(void) @@ -2426,7 +2426,7 @@ JS_AnchorPtr(void *p); * JS_CallTracer whenever the root contains a traceable thing. * data: the data argument to pass to each invocation of traceOp. */ -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_AddExtraGCRootsTracer(JSRuntime *rt, JSTraceDataOp traceOp, void *data); /* Undo a call to JS_AddExtraGCRootsTracer. */ @@ -2446,7 +2446,7 @@ JS_RemoveExtraGCRootsTracer(JSRuntime *rt, JSTraceDataOp traceOp, void *data); * Use the following macros to check if a particular jsval is a traceable * thing and to extract the thing and its kind to pass to JS_CallTracer. */ -static JS_ALWAYS_INLINE JSBool +static JS_ALWAYS_INLINE bool JSVAL_IS_TRACEABLE(jsval v) { return JSVAL_IS_TRACEABLE_IMPL(JSVAL_TO_IMPL(v)); @@ -2641,7 +2641,7 @@ JS_TraceRuntime(JSTracer *trc); extern JS_PUBLIC_API(void) JS_GetTraceThingInfo(char *buf, size_t bufsize, JSTracer *trc, - void *thing, JSGCTraceKind kind, JSBool includeDetails); + void *thing, JSGCTraceKind kind, bool includeDetails); extern JS_PUBLIC_API(const char *) JS_GetTraceEdgeName(JSTracer *trc, char *buffer, int bufferSize); @@ -2663,7 +2663,7 @@ JS_GetTraceEdgeName(JSTracer *trc, char *buffer, int bufferSize); * graph roots. * thingToIgnore: thing to ignore during the graph traversal when non-null. */ -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_DumpHeap(JSRuntime *rt, FILE *fp, void* startThing, JSGCTraceKind kind, void *thingToFind, size_t maxDepth, void *thingToIgnore); @@ -2684,7 +2684,7 @@ JS_SetGCCallback(JSRuntime *rt, JSGCCallback cb, void *data); extern JS_PUBLIC_API(void) JS_SetFinalizeCallback(JSRuntime *rt, JSFinalizeCallback cb); -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_IsGCMarkingTracer(JSTracer *trc); /* @@ -2703,10 +2703,10 @@ JS_IsGCMarkingTracer(JSTracer *trc); * used as a key in a hashtable, then the object must be removed and * re-inserted with the correct hash. */ -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_IsAboutToBeFinalized(JS::Heap *objp); -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_IsAboutToBeFinalizedUnbarriered(JSObject **objp); typedef enum JSGCParamKey { @@ -2822,7 +2822,7 @@ JS_NewExternalString(JSContext *cx, const jschar *chars, size_t length, * Return whether 'str' was created with JS_NewExternalString or * JS_NewExternalStringWithClosure. */ -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_IsExternalString(JSString *str); /* @@ -3015,10 +3015,10 @@ class AutoIdArray : private AutoGCRooter } /* namespace JS */ -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_ValueToId(JSContext *cx, jsval v, jsid *idp); -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_IdToValue(JSContext *cx, jsid id, jsval *vp); /* @@ -3032,28 +3032,28 @@ JS_IdToValue(JSContext *cx, jsid id, jsval *vp); * The hint must be JSTYPE_STRING, JSTYPE_NUMBER, or JSTYPE_VOID (no hint). On * success the resulting value is stored in *vp. */ -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_DefaultValue(JSContext *cx, JSObject *obj, JSType hint, jsval *vp); -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_PropertyStub(JSContext *cx, JS::Handle obj, JS::Handle id, JS::MutableHandle vp); -extern JS_PUBLIC_API(JSBool) -JS_StrictPropertyStub(JSContext *cx, JS::Handle obj, JS::Handle id, JSBool strict, +extern JS_PUBLIC_API(bool) +JS_StrictPropertyStub(JSContext *cx, JS::Handle obj, JS::Handle id, bool strict, JS::MutableHandle vp); -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_DeletePropertyStub(JSContext *cx, JS::Handle obj, JS::Handle id, - JSBool *succeeded); + bool *succeeded); -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_EnumerateStub(JSContext *cx, JS::Handle obj); -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_ResolveStub(JSContext *cx, JS::Handle obj, JS::Handle id); -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_ConvertStub(JSContext *cx, JS::Handle obj, JSType type, JS::MutableHandle vp); @@ -3150,17 +3150,17 @@ JS_InitClass(JSContext *cx, JSObject *obj, JSObject *parent_proto, * Set up ctor.prototype = proto and proto.constructor = ctor with the * right property flags. */ -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_LinkConstructorAndPrototype(JSContext *cx, JSObject *ctor, JSObject *proto); extern JS_PUBLIC_API(JSClass *) JS_GetClass(JSObject *obj); -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_InstanceOf(JSContext *cx, JSObject *obj, JSClass *clasp, jsval *argv); -extern JS_PUBLIC_API(JSBool) -JS_HasInstance(JSContext *cx, JSObject *obj, jsval v, JSBool *bp); +extern JS_PUBLIC_API(bool) +JS_HasInstance(JSContext *cx, JSObject *obj, jsval v, bool *bp); extern JS_PUBLIC_API(void *) JS_GetPrivate(JSObject *obj); @@ -3172,16 +3172,16 @@ extern JS_PUBLIC_API(void *) JS_GetInstancePrivate(JSContext *cx, JSObject *obj, JSClass *clasp, jsval *argv); -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_GetPrototype(JSContext *cx, JS::Handle obj, JS::MutableHandle protop); -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_SetPrototype(JSContext *cx, JS::Handle obj, JS::Handle proto); extern JS_PUBLIC_API(JSObject *) JS_GetParent(JSObject *obj); -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_SetParent(JSContext *cx, JSObject *obj, JSObject *parent); extern JS_PUBLIC_API(JSObject *) @@ -3192,7 +3192,7 @@ JS_GetConstructor(JSContext *cx, JSObject *proto); * is moved by a copying GC). Return false on failure (likely out of memory), * and true with *idp containing the unique id on success. */ -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_GetObjectId(JSContext *cx, JSObject *obj, jsid *idp); namespace JS { @@ -3278,10 +3278,10 @@ extern JS_PUBLIC_API(JSObject *) JS_NewObject(JSContext *cx, JSClass *clasp, JSObject *proto, JSObject *parent); /* Queries the [[Extensible]] property of the object. */ -extern JS_PUBLIC_API(JSBool) -JS_IsExtensible(JSContext *cx, JS::Handle obj, JSBool *extensible); +extern JS_PUBLIC_API(bool) +JS_IsExtensible(JSContext *cx, JS::Handle obj, bool *extensible); -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_IsNative(JSObject *obj); extern JS_PUBLIC_API(JSRuntime *) @@ -3300,16 +3300,16 @@ JS_NewObjectWithGivenProto(JSContext *cx, JSClass *clasp, JSObject *proto, * through non-extensible objects, on the assumption that those are already * deep-frozen. */ -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_DeepFreezeObject(JSContext *cx, JSObject *obj); /* * Freezes an object; see ES5's Object.freeze(obj) method. */ -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_FreezeObject(JSContext *cx, JSObject *obj); -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_PreventExtensions(JSContext *cx, JS::Handle obj); extern JS_PUBLIC_API(JSObject *) @@ -3319,22 +3319,22 @@ extern JS_PUBLIC_API(JSObject *) JS_DefineObject(JSContext *cx, JSObject *obj, const char *name, JSClass *clasp, JSObject *proto, unsigned attrs); -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_DefineConstDoubles(JSContext *cx, JSObject *obj, const JSConstDoubleSpec *cds); -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_DefineProperties(JSContext *cx, JSObject *obj, const JSPropertySpec *ps); -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_DefineProperty(JSContext *cx, JSObject *obj, const char *name, jsval value, JSPropertyOp getter, JSStrictPropertyOp setter, unsigned attrs); -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_DefinePropertyById(JSContext *cx, JSObject *obj, jsid id, jsval value, JSPropertyOp getter, JSStrictPropertyOp setter, unsigned attrs); -extern JS_PUBLIC_API(JSBool) -JS_DefineOwnProperty(JSContext *cx, JSObject *obj, jsid id, jsval descriptor, JSBool *bp); +extern JS_PUBLIC_API(bool) +JS_DefineOwnProperty(JSContext *cx, JSObject *obj, jsid id, jsval descriptor, bool *bp); /* * Determine the attributes (JSPROP_* flags) of a property on a given object. @@ -3342,26 +3342,26 @@ JS_DefineOwnProperty(JSContext *cx, JSObject *obj, jsid id, jsval descriptor, JS * If the object does not have a property by that name, *foundp will be * false and the value of *attrsp is undefined. */ -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_GetPropertyAttributes(JSContext *cx, JSObject *obj, const char *name, - unsigned *attrsp, JSBool *foundp); + unsigned *attrsp, bool *foundp); /* * The same, but if the property is native, return its getter and setter via * *getterp and *setterp, respectively (and only if the out parameter pointer * is not null). */ -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_GetPropertyAttrsGetterAndSetter(JSContext *cx, JSObject *obj, const char *name, - unsigned *attrsp, JSBool *foundp, + unsigned *attrsp, bool *foundp, JSPropertyOp *getterp, JSStrictPropertyOp *setterp); -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_GetPropertyAttrsGetterAndSetterById(JSContext *cx, JSObject *obj, jsid id, - unsigned *attrsp, JSBool *foundp, + unsigned *attrsp, bool *foundp, JSPropertyOp *getterp, JSStrictPropertyOp *setterp); @@ -3371,41 +3371,41 @@ JS_GetPropertyAttrsGetterAndSetterById(JSContext *cx, JSObject *obj, * If the object does not have a property by that name, *foundp will be * false and nothing will be altered. */ -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_SetPropertyAttributes(JSContext *cx, JSObject *obj, const char *name, - unsigned attrs, JSBool *foundp); + unsigned attrs, bool *foundp); -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_DefinePropertyWithTinyId(JSContext *cx, JSObject *obj, const char *name, int8_t tinyid, jsval value, JSPropertyOp getter, JSStrictPropertyOp setter, unsigned attrs); -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_AlreadyHasOwnProperty(JSContext *cx, JSObject *obj, const char *name, - JSBool *foundp); + bool *foundp); -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_AlreadyHasOwnPropertyById(JSContext *cx, JSObject *obj, jsid id, - JSBool *foundp); + bool *foundp); -extern JS_PUBLIC_API(JSBool) -JS_HasProperty(JSContext *cx, JSObject *obj, const char *name, JSBool *foundp); +extern JS_PUBLIC_API(bool) +JS_HasProperty(JSContext *cx, JSObject *obj, const char *name, bool *foundp); -extern JS_PUBLIC_API(JSBool) -JS_HasPropertyById(JSContext *cx, JSObject *obj, jsid id, JSBool *foundp); +extern JS_PUBLIC_API(bool) +JS_HasPropertyById(JSContext *cx, JSObject *obj, jsid id, bool *foundp); -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_LookupProperty(JSContext *cx, JSObject *obj, const char *name, JS::MutableHandle vp); -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_LookupPropertyById(JSContext *cx, JSObject *obj, jsid id, JS::MutableHandle vp); -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_LookupPropertyWithFlags(JSContext *cx, JSObject *obj, const char *name, unsigned flags, JS::MutableHandle vp); -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_LookupPropertyWithFlagsById(JSContext *cx, JSObject *obj, jsid id, unsigned flags, JSObject **objp, JS::MutableHandle vp); @@ -3542,50 +3542,50 @@ class MutableHandleBase * an object on the prototype chain (returned in objp). If data->obj is null, * then this property was not found on the prototype chain. */ -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_GetPropertyDescriptorById(JSContext *cx, JSObject *obj, jsid id, unsigned flags, JSPropertyDescriptor *desc); -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_GetOwnPropertyDescriptor(JSContext *cx, JSObject *obj, jsid id, JS::MutableHandle vp); -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_GetProperty(JSContext *cx, JSObject *obj, const char *name, JS::MutableHandle vp); -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_GetPropertyDefault(JSContext *cx, JSObject *obj, const char *name, jsval def, JS::MutableHandle vp); -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_GetPropertyById(JSContext *cx, JSObject *obj, jsid id, JS::MutableHandle vp); -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_GetPropertyByIdDefault(JSContext *cx, JSObject *obj, jsid id, jsval def, JS::MutableHandle vp); -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_ForwardGetPropertyTo(JSContext *cx, JSObject *obj, jsid id, JSObject *onBehalfOf, JS::MutableHandle vp); -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_SetProperty(JSContext *cx, JSObject *obj, const char *name, JS::Handle v); -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_SetPropertyById(JSContext *cx, JSObject *obj, jsid id, JS::Handle v); -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_DeleteProperty(JSContext *cx, JSObject *obj, const char *name); -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_DeleteProperty2(JSContext *cx, JSObject *obj, const char *name, bool *succeeded); -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_DeletePropertyById(JSContext *cx, JSObject *obj, jsid id); -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_DeletePropertyById2(JSContext *cx, JSObject *obj, jsid id, bool *succeeded); -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_DefineUCProperty(JSContext *cx, JSObject *obj, const jschar *name, size_t namelen, jsval value, JSPropertyOp getter, JSStrictPropertyOp setter, @@ -3597,20 +3597,20 @@ JS_DefineUCProperty(JSContext *cx, JSObject *obj, * If the object does not have a property by that name, *foundp will be * false and the value of *attrsp is undefined. */ -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_GetUCPropertyAttributes(JSContext *cx, JSObject *obj, const jschar *name, size_t namelen, - unsigned *attrsp, JSBool *foundp); + unsigned *attrsp, bool *foundp); /* * The same, but if the property is native, return its getter and setter via * *getterp and *setterp, respectively (and only if the out parameter pointer * is not null). */ -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_GetUCPropertyAttrsGetterAndSetter(JSContext *cx, JSObject *obj, const jschar *name, size_t namelen, - unsigned *attrsp, JSBool *foundp, + unsigned *attrsp, bool *foundp, JSPropertyOp *getterp, JSStrictPropertyOp *setterp); @@ -3620,76 +3620,76 @@ JS_GetUCPropertyAttrsGetterAndSetter(JSContext *cx, JSObject *obj, * If the object does not have a property by that name, *foundp will be * false and nothing will be altered. */ -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_SetUCPropertyAttributes(JSContext *cx, JSObject *obj, const jschar *name, size_t namelen, - unsigned attrs, JSBool *foundp); + unsigned attrs, bool *foundp); -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_DefineUCPropertyWithTinyId(JSContext *cx, JSObject *obj, const jschar *name, size_t namelen, int8_t tinyid, jsval value, JSPropertyOp getter, JSStrictPropertyOp setter, unsigned attrs); -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_AlreadyHasOwnUCProperty(JSContext *cx, JSObject *obj, const jschar *name, - size_t namelen, JSBool *foundp); + size_t namelen, bool *foundp); -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_HasUCProperty(JSContext *cx, JSObject *obj, const jschar *name, size_t namelen, - JSBool *vp); + bool *vp); -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_LookupUCProperty(JSContext *cx, JSObject *obj, const jschar *name, size_t namelen, JS::MutableHandle vp); -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_GetUCProperty(JSContext *cx, JSObject *obj, const jschar *name, size_t namelen, JS::MutableHandle vp); -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_SetUCProperty(JSContext *cx, JSObject *obj, const jschar *name, size_t namelen, JS::Handle v); -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_DeleteUCProperty2(JSContext *cx, JSObject *obj, const jschar *name, size_t namelen, bool *succeeded); extern JS_PUBLIC_API(JSObject *) JS_NewArrayObject(JSContext *cx, int length, jsval *vector); -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_IsArrayObject(JSContext *cx, JSObject *obj); -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_GetArrayLength(JSContext *cx, JSObject *obj, uint32_t *lengthp); -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_SetArrayLength(JSContext *cx, JSObject *obj, uint32_t length); -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_DefineElement(JSContext *cx, JSObject *obj, uint32_t index, jsval value, JSPropertyOp getter, JSStrictPropertyOp setter, unsigned attrs); -extern JS_PUBLIC_API(JSBool) -JS_AlreadyHasOwnElement(JSContext *cx, JSObject *obj, uint32_t index, JSBool *foundp); +extern JS_PUBLIC_API(bool) +JS_AlreadyHasOwnElement(JSContext *cx, JSObject *obj, uint32_t index, bool *foundp); -extern JS_PUBLIC_API(JSBool) -JS_HasElement(JSContext *cx, JSObject *obj, uint32_t index, JSBool *foundp); +extern JS_PUBLIC_API(bool) +JS_HasElement(JSContext *cx, JSObject *obj, uint32_t index, bool *foundp); -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_LookupElement(JSContext *cx, JSObject *obj, uint32_t index, JS::MutableHandle vp); -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_GetElement(JSContext *cx, JSObject *obj, uint32_t index, JS::MutableHandle vp); -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_ForwardGetElementTo(JSContext *cx, JSObject *obj, uint32_t index, JSObject *onBehalfOf, JS::MutableHandle vp); @@ -3698,17 +3698,17 @@ JS_ForwardGetElementTo(JSContext *cx, JSObject *obj, uint32_t index, JSObject *o * not, |*present| will be set to false and the value of |vp| must not * be relied on. */ -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_GetElementIfPresent(JSContext *cx, JSObject *obj, uint32_t index, JSObject *onBehalfOf, - JS::MutableHandle vp, JSBool* present); + JS::MutableHandle vp, bool* present); -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_SetElement(JSContext *cx, JSObject *obj, uint32_t index, JS::MutableHandle vp); -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_DeleteElement(JSContext *cx, JSObject *obj, uint32_t index); -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_DeleteElement2(JSContext *cx, JSObject *obj, uint32_t index, bool *succeeded); /* @@ -3743,7 +3743,7 @@ JS_NewArrayBufferWithContents(JSContext *cx, void *contents); * A pointer to the buffer's data is returned in |*data|. This pointer can * be used until |*contents| is freed or has its ownership transferred. */ -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_StealArrayBufferContents(JSContext *cx, JSObject *obj, void **contents, uint8_t **data); @@ -3756,7 +3756,7 @@ JS_StealArrayBufferContents(JSContext *cx, JSObject *obj, void **contents, * operations on *|contents| is to free it, or pass it to * JS_NewArrayBufferWithContents or JS_ReallocateArrayBufferContents. */ -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_AllocateArrayBufferContents(JSContext *cx, uint32_t nbytes, void **contents, uint8_t **data); /* @@ -3764,7 +3764,7 @@ JS_AllocateArrayBufferContents(JSContext *cx, uint32_t nbytes, void **contents, * as appropriate. The new data pointer will be returned in data. If *contents is NULL, * behaves like JS_AllocateArrayBufferContents. */ -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_ReallocateArrayBufferContents(JSContext *cx, uint32_t nbytes, void **contents, uint8_t **data); extern JS_PUBLIC_API(JSIdArray *) @@ -3783,7 +3783,7 @@ JS_NewPropertyIterator(JSContext *cx, JSObject *obj); * property to visit using iterobj, or JSID_IS_VOID if there is no such property * left to visit. Return false on error. */ -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_NextProperty(JSContext *cx, JSObject *iterobj, jsid *idp); /* @@ -3795,7 +3795,7 @@ JS_NextProperty(JSContext *cx, JSObject *iterobj, jsid *idp); extern JS_PUBLIC_API(bool) JS_ArrayIterator(JSContext *cx, unsigned argc, jsval *vp); -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_CheckAccess(JSContext *cx, JSObject *obj, jsid id, JSAccessMode mode, jsval *vp, unsigned *attrsp); @@ -3923,17 +3923,17 @@ JS_GetFunctionArity(JSFunction *fun); * overwritten the "Function" identifier with a different constructor and then * created instances using that constructor that might be passed in as obj). */ -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_ObjectIsFunction(JSContext *cx, JSObject *obj); -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_ObjectIsCallable(JSContext *cx, JSObject *obj); -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_IsNativeFunction(JSObject *funobj, JSNative call); /* Return whether the given function is a valid constructor. */ -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_IsConstructor(JSFunction *fun); /* @@ -3944,7 +3944,7 @@ JS_IsConstructor(JSFunction *fun); extern JS_PUBLIC_API(JSObject*) JS_BindCallable(JSContext *cx, JSObject *callable, JSObject *newThis); -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_DefineFunctions(JSContext *cx, JSObject *obj, const JSFunctionSpec *fs); extern JS_PUBLIC_API(JSFunction *) @@ -3974,7 +3974,7 @@ JS_CloneFunctionObject(JSContext *cx, JSObject *funobj, JSObject *parent); * lines in a buffer until JS_BufferIsCompilableUnit is true, then pass it to * the compiler. */ -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_BufferIsCompilableUnit(JSContext *cx, JSObject *obj, const char *utf8, size_t length); extern JS_PUBLIC_API(JSScript *) @@ -4149,10 +4149,10 @@ JS_DecompileFunctionBody(JSContext *cx, JSFunction *fun, unsigned indent); * the bug; such code can continue to use the familiar JS_EvaluateScript, * etc., entry points. */ -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_ExecuteScript(JSContext *cx, JSObject *obj, JSScript *script, jsval *rval); -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_ExecuteScriptVersion(JSContext *cx, JSObject *obj, JSScript *script, jsval *rval, JSVersion version); @@ -4162,40 +4162,40 @@ JS_ExecuteScriptVersion(JSContext *cx, JSObject *obj, JSScript *script, jsval *r */ typedef enum JSExecPart { JSEXEC_PROLOG, JSEXEC_MAIN } JSExecPart; -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_EvaluateScript(JSContext *cx, JSObject *obj, const char *bytes, unsigned length, const char *filename, unsigned lineno, jsval *rval); -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_EvaluateScriptForPrincipals(JSContext *cx, JSObject *obj, JSPrincipals *principals, const char *bytes, unsigned length, const char *filename, unsigned lineno, jsval *rval); -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_EvaluateScriptForPrincipalsVersion(JSContext *cx, JSObject *obj, JSPrincipals *principals, const char *bytes, unsigned length, const char *filename, unsigned lineno, jsval *rval, JSVersion version); -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_EvaluateUCScript(JSContext *cx, JSObject *obj, const jschar *chars, unsigned length, const char *filename, unsigned lineno, jsval *rval); -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_EvaluateUCScriptForPrincipals(JSContext *cx, JSObject *obj, JSPrincipals *principals, const jschar *chars, unsigned length, const char *filename, unsigned lineno, jsval *rval); -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_EvaluateUCScriptForPrincipalsVersion(JSContext *cx, JSObject *obj, JSPrincipals *principals, const jschar *chars, unsigned length, @@ -4210,7 +4210,7 @@ JS_EvaluateUCScriptForPrincipalsVersion(JSContext *cx, JSObject *obj, * eval and the Function constructor). If originPrincipals is null, then the * value of principals is used as origin principals for the script. */ -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_EvaluateUCScriptForPrincipalsVersionOrigin(JSContext *cx, JSObject *obj, JSPrincipals *principals, JSPrincipals *originPrincipals, @@ -4234,15 +4234,15 @@ Evaluate(JSContext *cx, JS::Handle obj, CompileOptions options, } /* namespace JS */ -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_CallFunction(JSContext *cx, JSObject *obj, JSFunction *fun, unsigned argc, jsval *argv, jsval *rval); -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_CallFunctionName(JSContext *cx, JSObject *obj, const char *name, unsigned argc, jsval *argv, jsval *rval); -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_CallFunctionValue(JSContext *cx, JSObject *obj, jsval fval, unsigned argc, jsval *argv, jsval *rval); @@ -4303,7 +4303,7 @@ JS_GetOperationCallback(JSContext *cx); extern JS_PUBLIC_API(void) JS_TriggerOperationCallback(JSRuntime *rt); -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_IsRunning(JSContext *cx); /* @@ -4317,7 +4317,7 @@ JS_IsRunning(JSContext *cx); * * JS_SaveFrameChain deals with cx not having any code running on it. */ -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_SaveFrameChain(JSContext *cx); extern JS_PUBLIC_API(void) @@ -4381,16 +4381,16 @@ JS_InternUCStringN(JSContext *cx, const jschar *s, size_t length); extern JS_PUBLIC_API(JSString *) JS_InternUCString(JSContext *cx, const jschar *s); -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_CompareStrings(JSContext *cx, JSString *str1, JSString *str2, int32_t *result); -extern JS_PUBLIC_API(JSBool) -JS_StringEqualsAscii(JSContext *cx, JSString *str, const char *asciiBytes, JSBool *match); +extern JS_PUBLIC_API(bool) +JS_StringEqualsAscii(JSContext *cx, JSString *str, const char *asciiBytes, bool *match); extern JS_PUBLIC_API(size_t) JS_PutEscapedString(JSContext *cx, char *buffer, size_t size, JSString *str, char quote); -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_FileEscapedString(FILE *fp, JSString *str, char quote); /* @@ -4476,7 +4476,7 @@ JS_FORGET_STRING_FLATNESS(JSFlatString *fstr) * Additional APIs that avoid fallibility when given a flat string. */ -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_FlatStringEqualsAscii(JSFlatString *str, const char *asciiBytes); extern JS_PUBLIC_API(size_t) @@ -4518,7 +4518,7 @@ JS_ConcatStrings(JSContext *cx, JSString *left, JSString *right); * NB: This function does not store an additional zero byte or jschar after the * transcoded string. */ -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_DecodeBytes(JSContext *cx, const char *src, size_t srclen, jschar *dst, size_t *dstlenp); @@ -4629,22 +4629,22 @@ class JSAutoByteString /* * JSON functions */ -typedef JSBool (* JSONWriteCallback)(const jschar *buf, uint32_t len, void *data); +typedef bool (* JSONWriteCallback)(const jschar *buf, uint32_t len, void *data); /* * JSON.stringify as specified by ES5. */ -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_Stringify(JSContext *cx, jsval *vp, JSObject *replacer, jsval space, JSONWriteCallback callback, void *data); /* * JSON.parse as specified by ES5. */ -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_ParseJSON(JSContext *cx, const jschar *chars, uint32_t len, JS::MutableHandle vp); -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_ParseJSONWithReviver(JSContext *cx, const jschar *chars, uint32_t len, jsval reviver, jsval *vp); @@ -4663,7 +4663,7 @@ struct JSStructuredCloneCallbacks { /* Note: if the *data contains transferable objects, it can be read * only once */ -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_ReadStructuredClone(JSContext *cx, uint64_t *data, size_t nbytes, uint32_t version, jsval *vp, const JSStructuredCloneCallbacks *optionalCallbacks, @@ -4671,19 +4671,19 @@ JS_ReadStructuredClone(JSContext *cx, uint64_t *data, size_t nbytes, /* Note: On success, the caller is responsible for calling * JS_ClearStructuredClone(*datap, nbytesp). */ -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_WriteStructuredClone(JSContext *cx, jsval v, uint64_t **datap, size_t *nbytesp, const JSStructuredCloneCallbacks *optionalCallbacks, void *closure, jsval transferable); -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_ClearStructuredClone(const uint64_t *data, size_t nbytes); -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_StructuredCloneHasTransferables(const uint64_t *data, size_t nbytes, - JSBool *hasTransferable); + bool *hasTransferable); -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_StructuredClone(JSContext *cx, jsval v, jsval *vp, const JSStructuredCloneCallbacks *optionalCallbacks, void *closure); @@ -4758,22 +4758,22 @@ class JS_PUBLIC_API(JSAutoStructuredCloneBuffer) { JS_PUBLIC_API(void) JS_SetStructuredCloneCallbacks(JSRuntime *rt, const JSStructuredCloneCallbacks *callbacks); -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_ReadUint32Pair(JSStructuredCloneReader *r, uint32_t *p1, uint32_t *p2); -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_ReadBytes(JSStructuredCloneReader *r, void *p, size_t len); -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_ReadTypedArray(JSStructuredCloneReader *r, jsval *vp); -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_WriteUint32Pair(JSStructuredCloneWriter *w, uint32_t tag, uint32_t data); -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_WriteBytes(JSStructuredCloneWriter *w, const void *p, size_t len); -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_WriteTypedArray(JSStructuredCloneWriter *w, jsval v); /************************************************************************/ @@ -4785,7 +4785,7 @@ JS_WriteTypedArray(JSStructuredCloneWriter *w, jsval v); * specify their own locales. * The locale string remains owned by the caller. */ -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_SetDefaultLocale(JSRuntime *rt, const char *locale); /* @@ -4864,15 +4864,15 @@ JS_ReportErrorNumberUCArray(JSContext *cx, JSErrorCallback errorCallback, * warning was not converted into an error due to the JSOPTION_WERROR option * being set, false otherwise. */ -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_ReportWarning(JSContext *cx, const char *format, ...); -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_ReportErrorFlagsAndNumber(JSContext *cx, unsigned flags, JSErrorCallback errorCallback, void *userRef, const unsigned errorNumber, ...); -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_ReportErrorFlagsAndNumberUC(JSContext *cx, unsigned flags, JSErrorCallback errorCallback, void *userRef, const unsigned errorNumber, ...); @@ -4955,7 +4955,7 @@ JS_NewDateObjectMsec(JSContext *cx, double msec); /* * Infallible predicate to test whether obj is a date object. */ -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_ObjectIsDate(JSContext *cx, JSObject *obj); /* @@ -4982,14 +4982,14 @@ extern JS_PUBLIC_API(JSObject *) JS_NewUCRegExpObject(JSContext *cx, JSObject *obj, jschar *chars, size_t length, unsigned flags); extern JS_PUBLIC_API(void) -JS_SetRegExpInput(JSContext *cx, JSObject *obj, JSString *input, JSBool multiline); +JS_SetRegExpInput(JSContext *cx, JSObject *obj, JSString *input, bool multiline); extern JS_PUBLIC_API(void) JS_ClearRegExpStatics(JSContext *cx, JSObject *obj); -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_ExecuteRegExp(JSContext *cx, JSObject *obj, JSObject *reobj, jschar *chars, size_t length, - size_t *indexp, JSBool test, jsval *rval); + size_t *indexp, bool test, jsval *rval); /* RegExp interface for clients without a global object. */ @@ -4999,11 +4999,11 @@ JS_NewRegExpObjectNoStatics(JSContext *cx, char *bytes, size_t length, unsigned extern JS_PUBLIC_API(JSObject *) JS_NewUCRegExpObjectNoStatics(JSContext *cx, jschar *chars, size_t length, unsigned flags); -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_ExecuteRegExpNoStatics(JSContext *cx, JSObject *reobj, jschar *chars, size_t length, - size_t *indexp, JSBool test, jsval *rval); + size_t *indexp, bool test, jsval *rval); -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_ObjectIsRegExp(JSContext *cx, JSObject *obj); extern JS_PUBLIC_API(unsigned) @@ -5014,10 +5014,10 @@ JS_GetRegExpSource(JSContext *cx, JSObject *obj); /************************************************************************/ -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_IsExceptionPending(JSContext *cx); -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_GetPendingException(JSContext *cx, jsval *vp); extern JS_PUBLIC_API(void) @@ -5026,7 +5026,7 @@ JS_SetPendingException(JSContext *cx, jsval v); extern JS_PUBLIC_API(void) JS_ClearPendingException(JSContext *cx); -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_ReportPendingException(JSContext *cx); /* @@ -5063,14 +5063,14 @@ JS_ErrorFromException(JSContext *cx, jsval v); * Given a reported error's message and JSErrorReport struct pointer, throw * the corresponding exception on cx. */ -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_ThrowReportedError(JSContext *cx, const char *message, JSErrorReport *reportp); /* * Throws a StopIteration exception on cx. */ -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_ThrowStopIteration(JSContext *cx); extern JS_PUBLIC_API(intptr_t) @@ -5124,7 +5124,7 @@ class JSAutoSetRuntimeThread * new object. Otherwise, the native is called as an ordinary function and * JS_THIS may be used. */ -static JS_ALWAYS_INLINE JSBool +static JS_ALWAYS_INLINE bool JS_IsConstructing(JSContext *cx, const jsval *vp) { #ifdef DEBUG @@ -5177,7 +5177,7 @@ JS_SetGlobalCompilerOption(JSContext *cx, JSCompilerOption opt, uint32_t value); /* * Convert a uint32_t index into a jsid. */ -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_IndexToId(JSContext *cx, uint32_t index, jsid *id); /* @@ -5185,20 +5185,20 @@ JS_IndexToId(JSContext *cx, uint32_t index, jsid *id); * * |chars| may not be an index. */ -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_CharsToId(JSContext* cx, JS::TwoByteChars chars, jsid *idp); /* * Test if the given string is a valid ECMAScript identifier */ -extern JS_PUBLIC_API(JSBool) -JS_IsIdentifier(JSContext *cx, JSString *str, JSBool *isIdentifier); +extern JS_PUBLIC_API(bool) +JS_IsIdentifier(JSContext *cx, JSString *str, bool *isIdentifier); /* * Return the current script and line number of the most currently running * frame. Returns true if a scripted frame was found, false otherwise. */ -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_DescribeScriptedCaller(JSContext *cx, JSScript **script, unsigned *lineno); diff --git a/js/src/jsarray.cpp b/js/src/jsarray.cpp index ac982fccc4776..fa6c208dda866 100644 --- a/js/src/jsarray.cpp +++ b/js/src/jsarray.cpp @@ -49,7 +49,7 @@ using mozilla::DebugOnly; using mozilla::IsNaN; using mozilla::PointerRangeSize; -JSBool +bool js::GetLengthProperty(JSContext *cx, HandleObject obj, uint32_t *lengthp) { if (obj->is()) { @@ -150,7 +150,7 @@ DoubleIndexToId(JSContext *cx, double index, MutableHandleId id) * properly rooted and can be used as GC-protected storage for temporaries. */ static inline bool -DoGetElement(JSContext *cx, HandleObject obj, double index, JSBool *hole, MutableHandleValue vp) +DoGetElement(JSContext *cx, HandleObject obj, double index, bool *hole, MutableHandleValue vp) { RootedId id(cx); @@ -174,7 +174,7 @@ DoGetElement(JSContext *cx, HandleObject obj, double index, JSBool *hole, Mutabl } static inline bool -DoGetElement(JSContext *cx, HandleObject obj, uint32_t index, JSBool *hole, MutableHandleValue vp) +DoGetElement(JSContext *cx, HandleObject obj, uint32_t index, bool *hole, MutableHandleValue vp) { bool present; if (!JSObject::getElementIfPresent(cx, obj, obj, index, vp, &present)) @@ -202,8 +202,8 @@ AssertGreaterThanZero(uint32_t index) } template -static JSBool -GetElement(JSContext *cx, HandleObject obj, IndexType index, JSBool *hole, MutableHandleValue vp) +static bool +GetElement(JSContext *cx, HandleObject obj, IndexType index, bool *hole, MutableHandleValue vp) { AssertGreaterThanZero(index); if (obj->isNative() && index < obj->getDenseInitializedLength()) { @@ -263,7 +263,7 @@ js::GetElements(JSContext *cx, HandleObject aobj, uint32_t length, Value *vp) /* * Set the value of the property at the given index to v assuming v is rooted. */ -static JSBool +static bool SetArrayElement(JSContext *cx, HandleObject obj, double index, HandleValue v) { JS_ASSERT(index >= 0); @@ -316,7 +316,7 @@ SetArrayElement(JSContext *cx, HandleObject obj, double index, HandleValue v) * implement different semantics.) */ static bool -DeleteArrayElement(JSContext *cx, HandleObject obj, double index, JSBool *succeeded) +DeleteArrayElement(JSContext *cx, HandleObject obj, double index, bool *succeeded) { JS_ASSERT(index >= 0); JS_ASSERT(floor(index) == index); @@ -346,7 +346,7 @@ DeleteArrayElement(JSContext *cx, HandleObject obj, double index, JSBool *succee static bool DeletePropertyOrThrow(JSContext *cx, HandleObject obj, double index) { - JSBool succeeded; + bool succeeded; if (!DeleteArrayElement(cx, obj, index, &succeeded)) return false; if (succeeded) @@ -359,7 +359,7 @@ DeletePropertyOrThrow(JSContext *cx, HandleObject obj, double index) return obj->reportNotConfigurable(cx, id, JSREPORT_ERROR); } -JSBool +bool js::SetLengthProperty(JSContext *cx, HandleObject obj, double length) { RootedValue v(cx, NumberValue(length)); @@ -373,7 +373,7 @@ js::SetLengthProperty(JSContext *cx, HandleObject obj, double length) * array that caused this getter to be invoked. In the setter case to overcome * the JSPROP_SHARED attribute, we must define a shadowing length property. */ -static JSBool +static bool array_length_getter(JSContext *cx, HandleObject obj_, HandleId id, MutableHandleValue vp) { RootedObject obj(cx, obj_); @@ -388,8 +388,8 @@ array_length_getter(JSContext *cx, HandleObject obj_, HandleId id, MutableHandle return true; } -static JSBool -array_length_setter(JSContext *cx, HandleObject obj, HandleId id, JSBool strict, MutableHandleValue vp) +static bool +array_length_setter(JSContext *cx, HandleObject obj, HandleId id, bool strict, MutableHandleValue vp) { if (!obj->is()) { return JSObject::defineProperty(cx, obj, cx->names().length, vp, @@ -536,7 +536,7 @@ js::ArraySetLength(JSContext *cx, Handle arr, HandleId id, unsigne oldLen--; /* Steps 15b-d. */ - JSBool deleteSucceeded; + bool deleteSucceeded; if (!JSObject::deleteElement(cx, arr, oldLen, &deleteSucceeded)) return false; if (!deleteSucceeded) { @@ -596,7 +596,7 @@ js::ArraySetLength(JSContext *cx, Handle arr, HandleId id, unsigne index = indexes[i]; /* Steps 15b-d. */ - JSBool deleteSucceeded; + bool deleteSucceeded; if (!JSObject::deleteElement(cx, arr, index, &deleteSucceeded)) return false; if (!deleteSucceeded) { @@ -699,7 +699,7 @@ js::WouldDefinePastNonwritableLength(ExclusiveContext *cx, JSMSG_CANT_DEFINE_PAST_ARRAY_LENGTH); } -static JSBool +static bool array_addProperty(JSContext *cx, HandleObject obj, HandleId id, MutableHandleValue vp) { @@ -718,7 +718,7 @@ array_addProperty(JSContext *cx, HandleObject obj, HandleId id, return true; } -JSBool +bool js::ObjectMayHaveExtraIndexedProperties(JSObject *obj) { /* @@ -831,7 +831,7 @@ array_toSource_impl(JSContext *cx, CallArgs args) return false; for (uint32_t index = 0; index < length; index++) { - JSBool hole; + bool hole; if (!JS_CHECK_OPERATION_LIMIT(cx) || !GetElement(cx, obj, index, &hole, &elt)) { return false; @@ -956,7 +956,7 @@ array_join_sub(JSContext *cx, CallArgs &args, bool locale) if (!JS_CHECK_OPERATION_LIMIT(cx)) return false; - JSBool hole; + bool hole; if (!GetElement(cx, obj, i, &hole, &v)) return false; if (!hole && !v.isNullOrUndefined()) { @@ -970,7 +970,7 @@ array_join_sub(JSContext *cx, CallArgs &args, bool locale) if (!JS_CHECK_OPERATION_LIMIT(cx)) return false; - JSBool hole; + bool hole; if (!GetElement(cx, obj, index, &hole, &elt)) return false; @@ -1242,7 +1242,7 @@ array_reverse(JSContext *cx, unsigned argc, Value *vp) RootedValue lowval(cx), hival(cx); for (uint32_t i = 0, half = len / 2; i < half; i++) { - JSBool hole, hole2; + bool hole, hole2; if (!JS_CHECK_OPERATION_LIMIT(cx) || !GetElement(cx, obj, i, &hole, &lowval) || !GetElement(cx, obj, len - i - 1, &hole2, &hival)) @@ -1780,7 +1780,7 @@ js::array_sort(JSContext *cx, unsigned argc, Value *vp) return false; /* Clear vec[newlen] before including it in the rooted set. */ - JSBool hole; + bool hole; if (!GetElement(cx, obj, i, &hole, &v)) return false; if (hole) @@ -1873,7 +1873,7 @@ js::array_sort(JSContext *cx, unsigned argc, Value *vp) return true; } -JS_ALWAYS_INLINE JSBool +JS_ALWAYS_INLINE bool NewbornArrayPushImpl(JSContext *cx, HandleObject obj, const Value &v) { Rooted arr(cx, &obj->as()); @@ -1893,7 +1893,7 @@ NewbornArrayPushImpl(JSContext *cx, HandleObject obj, const Value &v) return true; } -JSBool +bool js_NewbornArrayPush(JSContext *cx, HandleObject obj, const Value &vp) { return NewbornArrayPushImpl(cx, obj, vp); @@ -1972,7 +1972,7 @@ js::array_pop(JSContext *cx, unsigned argc, Value *vp) index--; /* Step 5b, 5e. */ - JSBool hole; + bool hole; if (!GetElement(cx, obj, index, &hole, args.rval())) return false; @@ -2055,7 +2055,7 @@ js::array_shift(JSContext *cx, unsigned argc, Value *vp) } /* Steps 5, 10. */ - JSBool hole; + bool hole; if (!GetElement(cx, obj, uint32_t(0), &hole, args.rval())) return false; @@ -2126,7 +2126,7 @@ array_unshift(JSContext *cx, unsigned argc, Value *vp) RootedValue value(cx); do { --last, --upperIndex; - JSBool hole; + bool hole; if (!JS_CHECK_OPERATION_LIMIT(cx)) return false; if (!GetElement(cx, obj, last, &hole, &value)) @@ -2275,7 +2275,7 @@ array_splice(JSContext *cx, unsigned argc, Value *vp) RootedValue fromValue(cx); for (uint32_t k = 0; k < actualDeleteCount; k++) { - JSBool hole; + bool hole; if (!JS_CHECK_OPERATION_LIMIT(cx) || !GetElement(cx, obj, actualStart + k, &hole, &fromValue) || (!hole && !JSObject::defineElement(cx, arr, k, fromValue))) @@ -2325,7 +2325,7 @@ array_splice(JSContext *cx, unsigned argc, Value *vp) if (!JS_CHECK_OPERATION_LIMIT(cx)) return false; - JSBool hole; + bool hole; if (!GetElement(cx, obj, from, &hole, &fromValue)) return false; if (hole) { @@ -2396,7 +2396,7 @@ array_splice(JSContext *cx, unsigned argc, Value *vp) double from = k + actualDeleteCount - 1; double to = k + itemCount - 1; - JSBool hole; + bool hole; if (!GetElement(cx, obj, from, &hole, &fromValue)) return false; @@ -2509,7 +2509,7 @@ js::array_concat(JSContext *cx, unsigned argc, Value *vp) return false; RootedValue tmp(cx); for (uint32_t slot = 0; slot < alength; slot++) { - JSBool hole; + bool hole; if (!JS_CHECK_OPERATION_LIMIT(cx) || !GetElement(cx, obj, slot, &hole, &tmp)) return false; @@ -2537,7 +2537,7 @@ static bool array_slice(JSContext *cx, unsigned argc, Value *vp) { uint32_t length, begin, end, slot; - JSBool hole; + bool hole; CallArgs args = CallArgsFromVp(argc, vp); @@ -2665,7 +2665,7 @@ array_filter(JSContext *cx, unsigned argc, Value *vp) return false; /* Step a, b, and c.i. */ - JSBool kNotPresent; + bool kNotPresent; if (!GetElement(cx, obj, k, &kNotPresent, &kValue)) return false; @@ -2718,7 +2718,7 @@ IsArrayConstructor(const Value &v) v.toObject().as().native() == js_Array; } -static JSBool +static bool ArrayFromCallArgs(JSContext *cx, RootedTypeObject &type, CallArgs &args) { if (!InitArrayTypes(cx, type, args.array(), args.length())) diff --git a/js/src/jsarray.h b/js/src/jsarray.h index b2c7aaf519f7a..a6b68a4b38ae4 100644 --- a/js/src/jsarray.h +++ b/js/src/jsarray.h @@ -17,7 +17,7 @@ namespace js { const uint32_t MAX_ARRAY_INDEX = 4294967294u; } -inline JSBool +inline bool js_IdIsIndex(jsid id, uint32_t *indexp) { if (JSID_IS_INT(id)) { @@ -87,13 +87,13 @@ WouldDefinePastNonwritableLength(ExclusiveContext *cx, extern bool CanonicalizeArrayLengthValue(JSContext *cx, HandleValue v, uint32_t *canonicalized); -extern JSBool +extern bool GetLengthProperty(JSContext *cx, HandleObject obj, uint32_t *lengthp); -extern JSBool +extern bool SetLengthProperty(JSContext *cx, HandleObject obj, double length); -extern JSBool +extern bool ObjectMayHaveExtraIndexedProperties(JSObject *obj); /* @@ -143,7 +143,7 @@ js_ArrayInfo(JSContext *cx, unsigned argc, js::Value *vp); * extending the array to accommodate the element will never make the array * sparse, which requires that the array be completely filled.) */ -extern JSBool +extern bool js_NewbornArrayPush(JSContext *cx, js::HandleObject obj, const js::Value &v); /* Array constructor native. Exposed only so the JIT can know its address. */ diff --git a/js/src/jsatom.cpp b/js/src/jsatom.cpp index 41da218b1e6f6..233f5dc5d0f0d 100644 --- a/js/src/jsatom.cpp +++ b/js/src/jsatom.cpp @@ -113,7 +113,7 @@ const char js_yield_str[] = "yield"; */ #define JS_STRING_HASH_COUNT 1024 -JSBool +bool js::InitAtoms(JSRuntime *rt) { return rt->atoms.init(JS_STRING_HASH_COUNT); diff --git a/js/src/jsatom.h b/js/src/jsatom.h index 2f26a315e4b7d..70d1e2041ba93 100644 --- a/js/src/jsatom.h +++ b/js/src/jsatom.h @@ -169,7 +169,7 @@ extern const char * const TypeStrings[]; * memory. The caller must zero rt->atomState before calling this function and * only call it after js_InitGC successfully returns. */ -extern JSBool +extern bool InitAtoms(JSRuntime *rt); /* diff --git a/js/src/jsbool.cpp b/js/src/jsbool.cpp index 137f98afbafe0..b0de9250d2fa3 100644 --- a/js/src/jsbool.cpp +++ b/js/src/jsbool.cpp @@ -176,7 +176,7 @@ js_InitBooleanClass(JSContext *cx, HandleObject obj) } JSString * -js_BooleanToString(ExclusiveContext *cx, JSBool b) +js_BooleanToString(ExclusiveContext *cx, bool b) { return b ? cx->names().true_ : cx->names().false_; } diff --git a/js/src/jsbool.h b/js/src/jsbool.h index 61f609d53bee1..3854d1871a1dc 100644 --- a/js/src/jsbool.h +++ b/js/src/jsbool.h @@ -16,7 +16,7 @@ extern JSObject * js_InitBooleanClass(JSContext *cx, js::HandleObject obj); extern JSString * -js_BooleanToString(js::ExclusiveContext *cx, JSBool b); +js_BooleanToString(js::ExclusiveContext *cx, bool b); namespace js { diff --git a/js/src/jsclass.h b/js/src/jsclass.h index def641715d8a7..75bc672217514 100644 --- a/js/src/jsclass.h +++ b/js/src/jsclass.h @@ -133,62 +133,62 @@ typedef JS::Handle HandleSpecialId; /* js::Class operation signatures. */ -typedef JSBool +typedef bool (* LookupGenericOp)(JSContext *cx, HandleObject obj, HandleId id, MutableHandleObject objp, MutableHandleShape propp); -typedef JSBool +typedef bool (* LookupPropOp)(JSContext *cx, HandleObject obj, HandlePropertyName name, MutableHandleObject objp, MutableHandleShape propp); -typedef JSBool +typedef bool (* LookupElementOp)(JSContext *cx, HandleObject obj, uint32_t index, MutableHandleObject objp, MutableHandleShape propp); -typedef JSBool +typedef bool (* LookupSpecialOp)(JSContext *cx, HandleObject obj, HandleSpecialId sid, MutableHandleObject objp, MutableHandleShape propp); -typedef JSBool +typedef bool (* DefineGenericOp)(JSContext *cx, HandleObject obj, HandleId id, HandleValue value, PropertyOp getter, StrictPropertyOp setter, unsigned attrs); -typedef JSBool +typedef bool (* DefinePropOp)(JSContext *cx, HandleObject obj, HandlePropertyName name, HandleValue value, PropertyOp getter, StrictPropertyOp setter, unsigned attrs); -typedef JSBool +typedef bool (* DefineElementOp)(JSContext *cx, HandleObject obj, uint32_t index, HandleValue value, PropertyOp getter, StrictPropertyOp setter, unsigned attrs); -typedef JSBool +typedef bool (* DefineSpecialOp)(JSContext *cx, HandleObject obj, HandleSpecialId sid, HandleValue value, PropertyOp getter, StrictPropertyOp setter, unsigned attrs); -typedef JSBool +typedef bool (* GenericIdOp)(JSContext *cx, HandleObject obj, HandleObject receiver, HandleId id, MutableHandleValue vp); -typedef JSBool +typedef bool (* PropertyIdOp)(JSContext *cx, HandleObject obj, HandleObject receiver, HandlePropertyName name, MutableHandleValue vp); -typedef JSBool +typedef bool (* ElementIdOp)(JSContext *cx, HandleObject obj, HandleObject receiver, uint32_t index, MutableHandleValue vp); -typedef JSBool +typedef bool (* ElementIfPresentOp)(JSContext *cx, HandleObject obj, HandleObject receiver, uint32_t index, MutableHandleValue vp, bool* present); -typedef JSBool +typedef bool (* SpecialIdOp)(JSContext *cx, HandleObject obj, HandleObject receiver, HandleSpecialId sid, MutableHandleValue vp); -typedef JSBool -(* StrictGenericIdOp)(JSContext *cx, HandleObject obj, HandleId id, MutableHandleValue vp, JSBool strict); -typedef JSBool -(* StrictPropertyIdOp)(JSContext *cx, HandleObject obj, HandlePropertyName name, MutableHandleValue vp, JSBool strict); -typedef JSBool -(* StrictElementIdOp)(JSContext *cx, HandleObject obj, uint32_t index, MutableHandleValue vp, JSBool strict); -typedef JSBool -(* StrictSpecialIdOp)(JSContext *cx, HandleObject obj, HandleSpecialId sid, MutableHandleValue vp, JSBool strict); -typedef JSBool +typedef bool +(* StrictGenericIdOp)(JSContext *cx, HandleObject obj, HandleId id, MutableHandleValue vp, bool strict); +typedef bool +(* StrictPropertyIdOp)(JSContext *cx, HandleObject obj, HandlePropertyName name, MutableHandleValue vp, bool strict); +typedef bool +(* StrictElementIdOp)(JSContext *cx, HandleObject obj, uint32_t index, MutableHandleValue vp, bool strict); +typedef bool +(* StrictSpecialIdOp)(JSContext *cx, HandleObject obj, HandleSpecialId sid, MutableHandleValue vp, bool strict); +typedef bool (* GenericAttributesOp)(JSContext *cx, HandleObject obj, HandleId id, unsigned *attrsp); -typedef JSBool +typedef bool (* PropertyAttributesOp)(JSContext *cx, HandleObject obj, HandlePropertyName name, unsigned *attrsp); -typedef JSBool +typedef bool (* ElementAttributesOp)(JSContext *cx, HandleObject obj, uint32_t index, unsigned *attrsp); -typedef JSBool +typedef bool (* SpecialAttributesOp)(JSContext *cx, HandleObject obj, HandleSpecialId sid, unsigned *attrsp); -typedef JSBool -(* DeletePropertyOp)(JSContext *cx, HandleObject obj, HandlePropertyName name, JSBool *succeeded); -typedef JSBool -(* DeleteElementOp)(JSContext *cx, HandleObject obj, uint32_t index, JSBool *succeeded); -typedef JSBool -(* DeleteSpecialOp)(JSContext *cx, HandleObject obj, HandleSpecialId sid, JSBool *succeeded); +typedef bool +(* DeletePropertyOp)(JSContext *cx, HandleObject obj, HandlePropertyName name, bool *succeeded); +typedef bool +(* DeleteElementOp)(JSContext *cx, HandleObject obj, uint32_t index, bool *succeeded); +typedef bool +(* DeleteSpecialOp)(JSContext *cx, HandleObject obj, HandleSpecialId sid, bool *succeeded); typedef JSObject * diff --git a/js/src/jsclone.cpp b/js/src/jsclone.cpp index 22d677db18e57..dac5ca5598837 100644 --- a/js/src/jsclone.cpp +++ b/js/src/jsclone.cpp @@ -561,7 +561,7 @@ JSStructuredCloneWriter::checkStack() #endif } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_WriteTypedArray(JSStructuredCloneWriter *w, jsval v) { JS_ASSERT(v.isObject()); @@ -852,7 +852,7 @@ TagToV1ArrayType(uint32_t tag) return tag - SCTAG_TYPED_ARRAY_V1_MIN; } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_ReadTypedArray(JSStructuredCloneReader *r, jsval *vp) { uint32_t tag, nelems; diff --git a/js/src/jsclone.h b/js/src/jsclone.h index ea31617edf971..bf159b2671a86 100644 --- a/js/src/jsclone.h +++ b/js/src/jsclone.h @@ -131,7 +131,7 @@ struct JSStructuredCloneReader { // Any value passed to JS_ReadStructuredClone. void *closure; - friend JSBool JS_ReadTypedArray(JSStructuredCloneReader *r, jsval *vp); + friend bool JS_ReadTypedArray(JSStructuredCloneReader *r, jsval *vp); }; struct JSStructuredCloneWriter { @@ -201,7 +201,7 @@ struct JSStructuredCloneWriter { JS::RootedValue transferable; js::AutoObjectHashSet transferableObjects; - friend JSBool JS_WriteTypedArray(JSStructuredCloneWriter *w, jsval v); + friend bool JS_WriteTypedArray(JSStructuredCloneWriter *w, jsval v); }; #endif /* jsclone_h */ diff --git a/js/src/jscntxt.cpp b/js/src/jscntxt.cpp index 3acae47d6c136..9c9831b365527 100644 --- a/js/src/jscntxt.cpp +++ b/js/src/jscntxt.cpp @@ -488,14 +488,14 @@ checkReportFlags(JSContext *cx, unsigned *flags) return false; } -JSBool +bool js_ReportErrorVA(JSContext *cx, unsigned flags, const char *format, va_list ap) { char *message; jschar *ucmessage; size_t messagelen; JSErrorReport report; - JSBool warning; + bool warning; if (checkReportFlags(cx, &flags)) return true; @@ -630,7 +630,7 @@ js::PrintError(JSContext *cx, FILE *file, const char *message, JSErrorReport *re * * Returns true if the expansion succeeds (can fail if out of memory). */ -JSBool +bool js_ExpandErrorArguments(JSContext *cx, JSErrorCallback callback, void *userRef, const unsigned errorNumber, char **messagep, JSErrorReport *reportp, @@ -792,14 +792,14 @@ js_ExpandErrorArguments(JSContext *cx, JSErrorCallback callback, return false; } -JSBool +bool js_ReportErrorNumberVA(JSContext *cx, unsigned flags, JSErrorCallback callback, void *userRef, const unsigned errorNumber, ErrorArgumentsType argumentsType, va_list ap) { JSErrorReport report; char *message; - JSBool warning; + bool warning; if (checkReportFlags(cx, &flags)) return true; @@ -899,12 +899,12 @@ js_ReportIsNotDefined(JSContext *cx, const char *name) JS_ReportErrorNumber(cx, js_GetErrorMessage, NULL, JSMSG_NOT_DEFINED, name); } -JSBool +bool js_ReportIsNullOrUndefined(JSContext *cx, int spindex, HandleValue v, HandleString fallback) { char *bytes; - JSBool ok; + bool ok; bytes = DecompileValueGenerator(cx, spindex, v, fallback); if (!bytes) @@ -955,13 +955,13 @@ js_ReportMissingArg(JSContext *cx, HandleValue v, unsigned arg) js_free(bytes); } -JSBool +bool js_ReportValueErrorFlags(JSContext *cx, unsigned flags, const unsigned errorNumber, int spindex, HandleValue v, HandleString fallback, const char *arg1, const char *arg2) { char *bytes; - JSBool ok; + bool ok; JS_ASSERT(js_ErrorFormatString[errorNumber].argCount >= 1); JS_ASSERT(js_ErrorFormatString[errorNumber].argCount <= 3); @@ -990,7 +990,7 @@ js_GetErrorMessage(void *userRef, const char *locale, const unsigned errorNumber return NULL; } -JSBool +bool js_InvokeOperationCallback(JSContext *cx) { JS_ASSERT_REQUEST_DEPTH(cx); diff --git a/js/src/jscntxt.h b/js/src/jscntxt.h index 292e7153d328c..110e26cbb6002 100644 --- a/js/src/jscntxt.h +++ b/js/src/jscntxt.h @@ -730,10 +730,10 @@ enum ErrorArgumentsType { } /* namespace js */ #ifdef va_start -extern JSBool +extern bool js_ReportErrorVA(JSContext *cx, unsigned flags, const char *format, va_list ap); -extern JSBool +extern bool js_ReportErrorNumberVA(JSContext *cx, unsigned flags, JSErrorCallback callback, void *userRef, const unsigned errorNumber, js::ErrorArgumentsType argumentsType, va_list ap); @@ -744,7 +744,7 @@ js_ReportErrorNumberUCArray(JSContext *cx, unsigned flags, JSErrorCallback callb const jschar **args); #endif -extern JSBool +extern bool js_ExpandErrorArguments(JSContext *cx, JSErrorCallback callback, void *userRef, const unsigned errorNumber, char **message, JSErrorReport *reportp, @@ -780,7 +780,7 @@ js_ReportIsNotDefined(JSContext *cx, const char *name); /* * Report an attempt to access the property of a null or undefined value (v). */ -extern JSBool +extern bool js_ReportIsNullOrUndefined(JSContext *cx, int spindex, js::HandleValue v, js::HandleString fallback); @@ -792,7 +792,7 @@ js_ReportMissingArg(JSContext *cx, js::HandleValue v, unsigned arg); * the first argument for the error message. If the error message has less * then 3 arguments, use null for arg1 or arg2. */ -extern JSBool +extern bool js_ReportValueErrorFlags(JSContext *cx, unsigned flags, const unsigned errorNumber, int spindex, js::HandleValue v, js::HandleString fallback, const char *arg1, const char *arg2); @@ -821,7 +821,7 @@ extern const JSErrorFormatString js_ErrorFormatString[JSErr_Limit]; * Invoke the operation callback and return false if the current execution * is to be terminated. */ -extern JSBool +extern bool js_InvokeOperationCallback(JSContext *cx); extern bool diff --git a/js/src/jscntxtinlines.h b/js/src/jscntxtinlines.h index b11840b9ca608..332f4a5d5888f 100644 --- a/js/src/jscntxtinlines.h +++ b/js/src/jscntxtinlines.h @@ -293,7 +293,7 @@ CallJSPropertyOp(JSContext *cx, PropertyOp op, HandleObject receiver, HandleId i JS_CHECK_RECURSION(cx, return false); assertSameCompartment(cx, receiver, id, vp); - JSBool ok = op(cx, receiver, id, vp); + bool ok = op(cx, receiver, id, vp); if (ok) assertSameCompartment(cx, vp); return ok; @@ -301,7 +301,7 @@ CallJSPropertyOp(JSContext *cx, PropertyOp op, HandleObject receiver, HandleId i JS_ALWAYS_INLINE bool CallJSPropertyOpSetter(JSContext *cx, StrictPropertyOp op, HandleObject obj, HandleId id, - JSBool strict, MutableHandleValue vp) + bool strict, MutableHandleValue vp) { JS_CHECK_RECURSION(cx, return false); @@ -311,7 +311,7 @@ CallJSPropertyOpSetter(JSContext *cx, StrictPropertyOp op, HandleObject obj, Han static inline bool CallJSDeletePropertyOp(JSContext *cx, JSDeletePropertyOp op, HandleObject receiver, HandleId id, - JSBool *succeeded) + bool *succeeded) { JS_CHECK_RECURSION(cx, return false); @@ -321,7 +321,7 @@ CallJSDeletePropertyOp(JSContext *cx, JSDeletePropertyOp op, HandleObject receiv inline bool CallSetter(JSContext *cx, HandleObject obj, HandleId id, StrictPropertyOp op, unsigned attrs, - unsigned shortid, JSBool strict, MutableHandleValue vp) + unsigned shortid, bool strict, MutableHandleValue vp) { if (attrs & JSPROP_SETTER) { RootedValue opv(cx, CastAsObjectJsval(op)); diff --git a/js/src/jsdate.cpp b/js/src/jsdate.cpp index 95c7b7e06a849..f91f564d69bc0 100644 --- a/js/src/jsdate.cpp +++ b/js/src/jsdate.cpp @@ -512,7 +512,7 @@ MakeTime(double hour, double min, double sec, double ms) * end of ECMA 'support' functions */ -static JSBool +static bool date_convert(JSContext *cx, HandleObject obj, JSType hint, MutableHandleValue vp) { JS_ASSERT(hint == JSTYPE_NUMBER || hint == JSTYPE_STRING || hint == JSTYPE_VOID); @@ -565,11 +565,11 @@ static const int ttb[] = { }; /* helper for date_parse */ -static JSBool +static bool date_regionMatches(const char* s1, int s1off, const jschar* s2, int s2off, int count, int ignoreCase) { - JSBool result = false; + bool result = false; /* return true if matches, otherwise, false */ while (count > 0 && s1[s1off] && s2[s2off]) { @@ -604,7 +604,7 @@ date_msecFromDate(double year, double mon, double mday, double hour, /* compute the time in msec (unclipped) from the given args */ #define MAXARGS 7 -static JSBool +static bool date_msecFromArgs(JSContext *cx, CallArgs args, double *rval) { unsigned loop; @@ -666,7 +666,7 @@ date_UTC(JSContext *cx, unsigned argc, Value *vp) * Succeed if any digits are converted. Advance *i only * as digits are consumed. */ -static JSBool +static bool digits(size_t *result, const jschar *s, size_t *i, size_t limit) { size_t init = *i; @@ -688,7 +688,7 @@ digits(size_t *result, const jschar *s, size_t *i, size_t limit) * Succeed if any digits are converted. Advance *i only * as digits are consumed. */ -static JSBool +static bool fractional(double *result, const jschar *s, size_t *i, size_t limit) { double factor = 0.1; @@ -710,7 +710,7 @@ fractional(double *result, const jschar *s, size_t *i, size_t limit) * Succeed if exactly n digits are converted. Advance *i only * on success. */ -static JSBool +static bool ndigits(size_t n, size_t *result, const jschar *s, size_t* i, size_t limit) { size_t init = *i; @@ -786,7 +786,7 @@ DaysInMonth(int year, int month) * TZD = time zone designator (Z or +hh:mm or -hh:mm or missing for local) */ -static JSBool +static bool date_parseISOString(JSLinearString *str, double *result, DateTimeInfo *dtInfo) { double msec; @@ -925,7 +925,7 @@ date_parseISOString(JSLinearString *str, double *result, DateTimeInfo *dtInfo) #undef NEED_NDIGITS } -static JSBool +static bool date_parseString(JSLinearString *str, double *result, DateTimeInfo *dtInfo) { double msec; @@ -943,9 +943,9 @@ date_parseString(JSLinearString *str, double *result, DateTimeInfo *dtInfo) int n = -1; int tzoffset = -1; int prevc = 0; - JSBool seenplusminus = false; + bool seenplusminus = false; int temp; - JSBool seenmonthname = false; + bool seenmonthname = false; if (date_parseISOString(str, result, dtInfo)) return true; @@ -2542,12 +2542,12 @@ typedef enum formatspec { } formatspec; /* helper function */ -static JSBool +static bool date_format(JSContext *cx, double date, formatspec format, MutableHandleValue rval) { char buf[100]; char tzbuf[100]; - JSBool usetz; + bool usetz; size_t i, tzlen; PRMJTime split; @@ -3092,7 +3092,7 @@ js_NewDateObject(JSContext *cx, int year, int mon, int mday, return js_NewDateObjectMsec(cx, UTC(msec_time, &cx->runtime()->dateTimeInfo)); } -JS_FRIEND_API(JSBool) +JS_FRIEND_API(bool) js_DateIsValid(JSObject *obj) { return obj->is() && !IsNaN(obj->as().UTCTime().toNumber()); diff --git a/js/src/jsdbgapi.cpp b/js/src/jsdbgapi.cpp index c25f11dd26b7d..9462901a545e8 100644 --- a/js/src/jsdbgapi.cpp +++ b/js/src/jsdbgapi.cpp @@ -43,20 +43,20 @@ using namespace js::gc; using mozilla::PodZero; -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_GetDebugMode(JSContext *cx) { return cx->compartment()->debugMode(); } -JS_PUBLIC_API(JSBool) -JS_SetDebugMode(JSContext *cx, JSBool debug) +JS_PUBLIC_API(bool) +JS_SetDebugMode(JSContext *cx, bool debug) { return JS_SetDebugModeForCompartment(cx, cx->compartment(), debug); } JS_PUBLIC_API(void) -JS_SetRuntimeDebugMode(JSRuntime *rt, JSBool debug) +JS_SetRuntimeDebugMode(JSRuntime *rt, bool debug) { rt->debugMode = !!debug; } @@ -111,7 +111,7 @@ js::ScriptDebugEpilogue(JSContext *cx, AbstractFramePtr frame, bool okArg) { JS_ASSERT_IF(frame.isStackFrame(), frame.asStackFrame() == cx->interpreterFrame()); - JSBool ok = okArg; + bool ok = okArg; // We don't add hook data for self-hosted scripts, so we don't need to check for them, here. if (void *hookData = frame.maybeHookData()) { @@ -169,8 +169,8 @@ js::DebugExceptionUnwind(JSContext *cx, AbstractFramePtr frame, jsbytecode *pc) return status; } -JS_FRIEND_API(JSBool) -JS_SetDebugModeForAllCompartments(JSContext *cx, JSBool debug) +JS_FRIEND_API(bool) +JS_SetDebugModeForAllCompartments(JSContext *cx, bool debug) { AutoDebugModeGC dmgc(cx->runtime()); @@ -184,17 +184,17 @@ JS_SetDebugModeForAllCompartments(JSContext *cx, JSBool debug) return true; } -JS_FRIEND_API(JSBool) -JS_SetDebugModeForCompartment(JSContext *cx, JSCompartment *comp, JSBool debug) +JS_FRIEND_API(bool) +JS_SetDebugModeForCompartment(JSContext *cx, JSCompartment *comp, bool debug) { AutoDebugModeGC dmgc(cx->runtime()); return comp->setDebugModeFromC(cx, !!debug, dmgc); } -static JSBool +static bool CheckDebugMode(JSContext *cx) { - JSBool debugMode = JS_GetDebugMode(cx); + bool debugMode = JS_GetDebugMode(cx); /* * :TODO: * This probably should be an assertion, since it's indicative of a severe @@ -207,8 +207,8 @@ CheckDebugMode(JSContext *cx) return debugMode; } -JS_PUBLIC_API(JSBool) -JS_SetSingleStepMode(JSContext *cx, JSScript *scriptArg, JSBool singleStep) +JS_PUBLIC_API(bool) +JS_SetSingleStepMode(JSContext *cx, JSScript *scriptArg, bool singleStep) { RootedScript script(cx, scriptArg); assertSameCompartment(cx, script); @@ -219,7 +219,7 @@ JS_SetSingleStepMode(JSContext *cx, JSScript *scriptArg, JSBool singleStep) return script->setStepModeFlag(cx, singleStep); } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_SetTrap(JSContext *cx, JSScript *scriptArg, jsbytecode *pc, JSTrapHandler handler, jsval closureArg) { RootedScript script(cx, scriptArg); @@ -262,7 +262,7 @@ JS_ClearAllTrapsForCompartment(JSContext *cx) cx->compartment()->clearTraps(cx->runtime()->defaultFreeOp()); } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_SetInterrupt(JSRuntime *rt, JSInterruptHook hook, void *closure) { rt->debugHooks.interruptHook = hook; @@ -272,7 +272,7 @@ JS_SetInterrupt(JSRuntime *rt, JSInterruptHook hook, void *closure) return true; } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_ClearInterrupt(JSRuntime *rt, JSInterruptHook *hoop, void **closurep) { if (hoop) @@ -286,7 +286,7 @@ JS_ClearInterrupt(JSRuntime *rt, JSInterruptHook *hoop, void **closurep) /************************************************************************/ -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_SetWatchPoint(JSContext *cx, JSObject *obj_, jsid id_, JSWatchPointHandler handler, JSObject *closure_) { @@ -348,7 +348,7 @@ JS_SetWatchPoint(JSContext *cx, JSObject *obj_, jsid id_, return wpmap->watch(cx, obj, propid, handler, closure); } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_ClearWatchPoint(JSContext *cx, JSObject *obj, jsid id, JSWatchPointHandler *handlerp, JSObject **closurep) { @@ -359,7 +359,7 @@ JS_ClearWatchPoint(JSContext *cx, JSObject *obj, jsid id, return true; } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_ClearWatchPointsForObject(JSContext *cx, JSObject *obj) { assertSameCompartment(cx, obj); @@ -369,7 +369,7 @@ JS_ClearWatchPointsForObject(JSContext *cx, JSObject *obj) return true; } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_ClearAllWatchPoints(JSContext *cx) { if (JSCompartment *comp = cx->compartment()) { @@ -399,7 +399,7 @@ JS_EndPC(JSContext *cx, JSScript *script) return script->code + script->length; } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_GetLinePCs(JSContext *cx, JSScript *script, unsigned startLine, unsigned maxLines, unsigned* count, unsigned** retLines, jsbytecode*** retPCs) @@ -456,7 +456,7 @@ JS_GetFunctionArgumentCount(JSContext *cx, JSFunction *fun) return fun->nargs; } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_FunctionHasLocalNames(JSContext *cx, JSFunction *fun) { return fun->nonLazyScript()->bindings.count() > 0; @@ -625,7 +625,7 @@ JS_SetDestroyScriptHook(JSRuntime *rt, JSDestroyScriptHook hook, /* This all should be reworked to avoid requiring JSScopeProperty types. */ -static JSBool +static bool GetPropertyDesc(JSContext *cx, JSObject *obj_, HandleShape shape, JSPropertyDesc *pd) { assertSameCompartment(cx, obj_); @@ -633,7 +633,7 @@ GetPropertyDesc(JSContext *cx, JSObject *obj_, HandleShape shape, JSPropertyDesc RootedObject obj(cx, obj_); - JSBool wasThrowing = cx->isExceptionPending(); + bool wasThrowing = cx->isExceptionPending(); RootedValue lastException(cx, UndefinedValue()); if (wasThrowing) lastException = cx->getPendingException(); @@ -666,7 +666,7 @@ GetPropertyDesc(JSContext *cx, JSObject *obj_, HandleShape shape, JSPropertyDesc return true; } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_GetPropertyDescArray(JSContext *cx, JSObject *obj_, JSPropertyDescArray *pda) { RootedObject obj(cx, obj_); @@ -774,7 +774,7 @@ JS_PutPropertyDescArray(JSContext *cx, JSPropertyDescArray *pda) /************************************************************************/ -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_SetDebuggerHandler(JSRuntime *rt, JSDebuggerHandler handler, void *closure) { rt->debugHooks.debuggerHandler = handler; @@ -782,7 +782,7 @@ JS_SetDebuggerHandler(JSRuntime *rt, JSDebuggerHandler handler, void *closure) return true; } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_SetSourceHandler(JSRuntime *rt, JSSourceHandler handler, void *closure) { rt->debugHooks.sourceHandler = handler; @@ -790,7 +790,7 @@ JS_SetSourceHandler(JSRuntime *rt, JSSourceHandler handler, void *closure) return true; } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_SetExecuteHook(JSRuntime *rt, JSInterpreterHook hook, void *closure) { rt->debugHooks.executeHook = hook; @@ -798,7 +798,7 @@ JS_SetExecuteHook(JSRuntime *rt, JSInterpreterHook hook, void *closure) return true; } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_SetCallHook(JSRuntime *rt, JSInterpreterHook hook, void *closure) { rt->debugHooks.callHook = hook; @@ -806,7 +806,7 @@ JS_SetCallHook(JSRuntime *rt, JSInterpreterHook hook, void *closure) return true; } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_SetThrowHook(JSRuntime *rt, JSThrowHook hook, void *closure) { rt->debugHooks.throwHook = hook; @@ -814,7 +814,7 @@ JS_SetThrowHook(JSRuntime *rt, JSThrowHook hook, void *closure) return true; } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_SetDebugErrorHook(JSRuntime *rt, JSDebugErrorHook hook, void *closure) { rt->debugHooks.debugErrorHook = hook; @@ -930,7 +930,7 @@ JS_DumpCompartmentPCCounts(JSContext *cx) #endif } -JS_FRIEND_API(JSBool) +JS_FRIEND_API(bool) js_CallContextDebugHandler(JSContext *cx) { NonBuiltinScriptFrameIter iter(cx); @@ -1030,7 +1030,7 @@ FormatValue(JSContext *cx, const Value &vArg, JSAutoByteString &bytes) static char * FormatFrame(JSContext *cx, const NonBuiltinScriptFrameIter &iter, char *buf, int num, - JSBool showArgs, JSBool showLocals, JSBool showThisProps) + bool showArgs, bool showLocals, bool showThisProps) { JS_ASSERT(!cx->isExceptionPending()); RootedScript script(cx, iter.script()); @@ -1228,9 +1228,7 @@ FormatFrame(JSContext *cx, const NonBuiltinScriptFrameIter &iter, char *buf, int } JS_PUBLIC_API(char *) -JS::FormatStackDump(JSContext *cx, char *buf, - JSBool showArgs, JSBool showLocals, - JSBool showThisProps) +JS::FormatStackDump(JSContext *cx, char *buf, bool showArgs, bool showLocals, bool showThisProps) { int num = 0; diff --git a/js/src/jsdbgapi.h b/js/src/jsdbgapi.h index 61652133f3cbd..32dfc220029b6 100644 --- a/js/src/jsdbgapi.h +++ b/js/src/jsdbgapi.h @@ -34,9 +34,7 @@ extern JS_PUBLIC_API(void) FreeStackDescription(JSContext *cx, StackDescription *desc); extern JS_PUBLIC_API(char *) -FormatStackDump(JSContext *cx, char *buf, - JSBool showArgs, JSBool showLocals, - JSBool showThisProps); +FormatStackDump(JSContext *cx, char *buf, bool showArgs, bool showLocals, bool showThisProps); } @@ -60,7 +58,7 @@ JS_DecompileScript(JSContext *cx, JSScript *script, const char *name, unsigned i * be able to support compartment-wide debugging. */ extern JS_PUBLIC_API(void) -JS_SetRuntimeDebugMode(JSRuntime *rt, JSBool debug); +JS_SetRuntimeDebugMode(JSRuntime *rt, bool debug); /* * Debug mode is a compartment-wide mode that enables a debugger to attach @@ -73,36 +71,36 @@ JS_SetRuntimeDebugMode(JSRuntime *rt, JSBool debug); */ /* Get current state of debugging mode. */ -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_GetDebugMode(JSContext *cx); /* * Turn on/off debugging mode for all compartments. This returns false if any code * from any of the runtime's compartments is running or on the stack. */ -JS_FRIEND_API(JSBool) -JS_SetDebugModeForAllCompartments(JSContext *cx, JSBool debug); +JS_FRIEND_API(bool) +JS_SetDebugModeForAllCompartments(JSContext *cx, bool debug); /* * Turn on/off debugging mode for a single compartment. This should only be * used when no code from this compartment is running or on the stack in any * thread. */ -JS_FRIEND_API(JSBool) -JS_SetDebugModeForCompartment(JSContext *cx, JSCompartment *comp, JSBool debug); +JS_FRIEND_API(bool) +JS_SetDebugModeForCompartment(JSContext *cx, JSCompartment *comp, bool debug); /* * Turn on/off debugging mode for a context's compartment. */ -JS_FRIEND_API(JSBool) -JS_SetDebugMode(JSContext *cx, JSBool debug); +JS_FRIEND_API(bool) +JS_SetDebugMode(JSContext *cx, bool debug); /* Turn on single step mode. */ -extern JS_PUBLIC_API(JSBool) -JS_SetSingleStepMode(JSContext *cx, JSScript *script, JSBool singleStep); +extern JS_PUBLIC_API(bool) +JS_SetSingleStepMode(JSContext *cx, JSScript *script, bool singleStep); /* The closure argument will be marked. */ -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_SetTrap(JSContext *cx, JSScript *script, jsbytecode *pc, JSTrapHandler handler, jsval closure); @@ -116,26 +114,26 @@ JS_ClearScriptTraps(JSRuntime *rt, JSScript *script); extern JS_PUBLIC_API(void) JS_ClearAllTrapsForCompartment(JSContext *cx); -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_SetInterrupt(JSRuntime *rt, JSInterruptHook handler, void *closure); -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_ClearInterrupt(JSRuntime *rt, JSInterruptHook *handlerp, void **closurep); /************************************************************************/ -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_SetWatchPoint(JSContext *cx, JSObject *obj, jsid id, JSWatchPointHandler handler, JSObject *closure); -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_ClearWatchPoint(JSContext *cx, JSObject *obj, jsid id, JSWatchPointHandler *handlerp, JSObject **closurep); -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_ClearWatchPointsForObject(JSContext *cx, JSObject *obj); -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_ClearAllWatchPoints(JSContext *cx); /************************************************************************/ @@ -150,7 +148,7 @@ JS_LineNumberToPC(JSContext *cx, JSScript *script, unsigned lineno); extern JS_PUBLIC_API(jsbytecode *) JS_EndPC(JSContext *cx, JSScript *script); -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_GetLinePCs(JSContext *cx, JSScript *script, unsigned startLine, unsigned maxLines, unsigned* count, unsigned** lines, jsbytecode*** pcs); @@ -158,7 +156,7 @@ JS_GetLinePCs(JSContext *cx, JSScript *script, extern JS_PUBLIC_API(unsigned) JS_GetFunctionArgumentCount(JSContext *cx, JSFunction *fun); -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_FunctionHasLocalNames(JSContext *cx, JSFunction *fun); /* @@ -270,7 +268,7 @@ typedef struct JSPropertyDescArray { typedef struct JSScopeProperty JSScopeProperty; -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_GetPropertyDescArray(JSContext *cx, JSObject *obj, JSPropertyDescArray *pda); extern JS_PUBLIC_API(void) @@ -378,9 +376,9 @@ class JS_PUBLIC_API(JSBrokenFrameIterator) */ typedef void * (* JSInterpreterHook)(JSContext *cx, JSAbstractFramePtr frame, bool isConstructing, - JSBool before, JSBool *ok, void *closure); + bool before, bool *ok, void *closure); -typedef JSBool +typedef bool (* JSDebugErrorHook)(JSContext *cx, const char *message, JSErrorReport *report, void *closure); @@ -407,22 +405,22 @@ typedef struct JSDebugHooks { /************************************************************************/ -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_SetDebuggerHandler(JSRuntime *rt, JSDebuggerHandler hook, void *closure); -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_SetSourceHandler(JSRuntime *rt, JSSourceHandler handler, void *closure); -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_SetExecuteHook(JSRuntime *rt, JSInterpreterHook hook, void *closure); -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_SetCallHook(JSRuntime *rt, JSInterpreterHook hook, void *closure); -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_SetThrowHook(JSRuntime *rt, JSThrowHook hook, void *closure); -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_SetDebugErrorHook(JSRuntime *rt, JSDebugErrorHook hook, void *closure); /************************************************************************/ @@ -433,11 +431,11 @@ JS_GetGlobalDebugHooks(JSRuntime *rt); /** * Add various profiling-related functions as properties of the given object. */ -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_DefineProfilingFunctions(JSContext *cx, JSObject *obj); /* Defined in vm/Debugger.cpp. */ -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_DefineDebuggerObject(JSContext *cx, JSObject *obj); extern JS_PUBLIC_API(void) @@ -453,7 +451,7 @@ extern JS_PUBLIC_API(void) JS_DumpCompartmentPCCounts(JSContext *cx); /* Call the context debug handler on the topmost scripted frame. */ -extern JS_FRIEND_API(JSBool) +extern JS_FRIEND_API(bool) js_CallContextDebugHandler(JSContext *cx); #endif /* jsdbgapi_h */ diff --git a/js/src/jsdtoa.cpp b/js/src/jsdtoa.cpp index 050edf9621d0a..54de74fc8530d 100644 --- a/js/src/jsdtoa.cpp +++ b/js/src/jsdtoa.cpp @@ -112,7 +112,7 @@ js_dtostr(DtoaState *state, char *buffer, size_t bufferSize, JSDToStrMode mode, /* If Infinity, -Infinity, or NaN, return the string regardless of mode. */ if (decPt != 9999) { - JSBool exponentialNotation = false; + bool exponentialNotation = false; int minNDigits = 0; /* Min number of significant digits required */ char *p; char *q; diff --git a/js/src/jsexn.cpp b/js/src/jsexn.cpp index f4d1e09957548..c20e144492f0e 100644 --- a/js/src/jsexn.cpp +++ b/js/src/jsexn.cpp @@ -51,7 +51,7 @@ exn_trace(JSTracer *trc, JSObject *obj); static void exn_finalize(FreeOp *fop, JSObject *obj); -static JSBool +static bool exn_resolve(JSContext *cx, HandleObject obj, HandleId id, unsigned flags, MutableHandleObject objp); @@ -382,7 +382,7 @@ exn_finalize(FreeOp *fop, JSObject *obj) } } -static JSBool +static bool exn_resolve(JSContext *cx, HandleObject obj, HandleId id, unsigned flags, MutableHandleObject objp) { @@ -896,7 +896,7 @@ static const struct exnname { char *name; char *exception; } errortoexnname[] = }; #endif /* DEBUG */ -JSBool +bool js_ErrorToException(JSContext *cx, const char *message, JSErrorReport *reportp, JSErrorCallback callback, void *userRef) { @@ -985,7 +985,7 @@ js_ErrorToException(JSContext *cx, const char *message, JSErrorReport *reportp, static bool IsDuckTypedErrorObject(JSContext *cx, HandleObject exnObject, const char **filename_strp) { - JSBool found; + bool found; if (!JS_HasProperty(cx, exnObject, js_message_str, &found) || !found) return false; @@ -1004,7 +1004,7 @@ IsDuckTypedErrorObject(JSContext *cx, HandleObject exnObject, const char **filen return true; } -JSBool +bool js_ReportUncaughtException(JSContext *cx) { JSErrorReport *reportp, report; diff --git a/js/src/jsexn.h b/js/src/jsexn.h index faa51f953e0e3..50b02f85ac6e3 100644 --- a/js/src/jsexn.h +++ b/js/src/jsexn.h @@ -27,7 +27,7 @@ js_InitExceptionClasses(JSContext *cx, js::HandleObject obj); * error reports so flagged. Returns true if an associated exception is * found and set, false otherwise. */ -extern JSBool +extern bool js_ErrorToException(JSContext *cx, const char *message, JSErrorReport *reportp, JSErrorCallback callback, void *userRef); @@ -47,7 +47,7 @@ js_ErrorToException(JSContext *cx, const char *message, JSErrorReport *reportp, * other contexts may want to use an error reporter that ignores errors with * this flag. */ -extern JSBool +extern bool js_ReportUncaughtException(JSContext *cx); extern JSErrorReport * diff --git a/js/src/jsfriendapi.cpp b/js/src/jsfriendapi.cpp index ab2e0f3e93a03..252474b60010e 100644 --- a/js/src/jsfriendapi.cpp +++ b/js/src/jsfriendapi.cpp @@ -94,7 +94,7 @@ JS_GetObjectFunction(JSObject *obj) return NULL; } -JS_FRIEND_API(JSBool) +JS_FRIEND_API(bool) JS_SplicePrototype(JSContext *cx, JSObject *objArg, JSObject *protoArg) { RootedObject obj(cx, objArg); @@ -242,13 +242,13 @@ JS_SetCompartmentPrincipals(JSCompartment *compartment, JSPrincipals *principals compartment->isSystem = isSystem; } -JS_FRIEND_API(JSBool) +JS_FRIEND_API(bool) JS_WrapPropertyDescriptor(JSContext *cx, js::PropertyDescriptor *desc) { return cx->compartment()->wrap(cx, desc); } -JS_FRIEND_API(JSBool) +JS_FRIEND_API(bool) JS_WrapAutoIdVector(JSContext *cx, js::AutoIdVector &props) { return cx->compartment()->wrap(cx, props); @@ -557,7 +557,7 @@ JS_GetCustomIteratorCount(JSContext *cx) return sCustomIteratorCount; } -JS_FRIEND_API(JSBool) +JS_FRIEND_API(bool) JS_IsDeadWrapper(JSObject *obj) { if (!obj->is()) { @@ -1102,9 +1102,9 @@ js::GetObjectMetadata(JSObject *obj) return obj->getMetadata(); } -JS_FRIEND_API(JSBool) +JS_FRIEND_API(bool) js_DefineOwnProperty(JSContext *cx, JSObject *objArg, jsid idArg, - const js::PropertyDescriptor& descriptor, JSBool *bp) + const js::PropertyDescriptor& descriptor, bool *bp) { RootedObject obj(cx, objArg); RootedId id(cx, idArg); @@ -1119,7 +1119,7 @@ js_DefineOwnProperty(JSContext *cx, JSObject *objArg, jsid idArg, return DefineOwnProperty(cx, HandleObject(obj), id, descriptor, bp); } -JS_FRIEND_API(JSBool) +JS_FRIEND_API(bool) js_ReportIsNotFunction(JSContext *cx, const JS::Value& v) { return ReportIsNotFunction(cx, v); diff --git a/js/src/jsfriendapi.h b/js/src/jsfriendapi.h index 9943f946bd970..696d02f6128a1 100644 --- a/js/src/jsfriendapi.h +++ b/js/src/jsfriendapi.h @@ -47,7 +47,7 @@ JS_FindCompilationScope(JSContext *cx, JSObject *obj); extern JS_FRIEND_API(JSFunction *) JS_GetObjectFunction(JSObject *obj); -extern JS_FRIEND_API(JSBool) +extern JS_FRIEND_API(bool) JS_SplicePrototype(JSContext *cx, JSObject *obj, JSObject *proto); extern JS_FRIEND_API(JSObject *) @@ -62,7 +62,7 @@ JS_SetProtoCalled(JSContext *cx); extern JS_FRIEND_API(size_t) JS_GetCustomIteratorCount(JSContext *cx); -extern JS_FRIEND_API(JSBool) +extern JS_FRIEND_API(bool) JS_NondeterministicGetWeakMapKeys(JSContext *cx, JSObject *obj, JSObject **ret); /* @@ -71,7 +71,7 @@ JS_NondeterministicGetWeakMapKeys(JSContext *cx, JSObject *obj, JSObject **ret); * Such objects hold no other objects (they have no outgoing reference edges) * and will throw if you touch them (e.g. by reading/writing a property). */ -extern JS_FRIEND_API(JSBool) +extern JS_FRIEND_API(bool) JS_IsDeadWrapper(JSObject *obj); /* @@ -126,8 +126,8 @@ JS_CloneObject(JSContext *cx, JSObject *obj, JSObject *proto, JSObject *parent); extern JS_FRIEND_API(JSString *) JS_BasicObjectToString(JSContext *cx, JS::HandleObject obj); -extern JS_FRIEND_API(JSBool) -js_GetterOnlyPropertyStub(JSContext *cx, JS::HandleObject obj, JS::HandleId id, JSBool strict, +extern JS_FRIEND_API(bool) +js_GetterOnlyPropertyStub(JSContext *cx, JS::HandleObject obj, JS::HandleId id, bool strict, JS::MutableHandleValue vp); JS_FRIEND_API(void) @@ -169,13 +169,13 @@ js_DumpChars(const jschar *s, size_t n); extern JS_FRIEND_API(bool) JS_CopyPropertiesFrom(JSContext *cx, JSObject *target, JSObject *obj); -extern JS_FRIEND_API(JSBool) +extern JS_FRIEND_API(bool) JS_WrapPropertyDescriptor(JSContext *cx, js::PropertyDescriptor *desc); -extern JS_FRIEND_API(JSBool) +extern JS_FRIEND_API(bool) JS_WrapAutoIdVector(JSContext *cx, JS::AutoIdVector &props); -extern JS_FRIEND_API(JSBool) +extern JS_FRIEND_API(bool) JS_EnumerateState(JSContext *cx, JS::HandleObject obj, JSIterateOp enum_op, js::MutableHandleValue statep, js::MutableHandleId idp); @@ -763,7 +763,7 @@ JS_FRIEND_API(bool) HasUnrootedGlobal(const JSContext *cx); typedef void -(* ActivityCallback)(void *arg, JSBool active); +(* ActivityCallback)(void *arg, bool active); /* * Sets a callback that is run whenever the runtime goes idle - the @@ -791,7 +791,7 @@ typedef void extern JS_FRIEND_API(AnalysisPurgeCallback) SetAnalysisPurgeCallback(JSRuntime *rt, AnalysisPurgeCallback callback); -typedef JSBool +typedef bool (* DOMInstanceClassMatchesProto)(JS::HandleObject protoObject, uint32_t protoID, uint32_t depth); struct JSDOMCallbacks { @@ -877,7 +877,7 @@ struct CompartmentsWithPrincipals : public CompartmentFilter { } }; -extern JS_FRIEND_API(JSBool) +extern JS_FRIEND_API(bool) NukeCrossCompartmentWrappers(JSContext* cx, const CompartmentFilter& sourceFilter, const CompartmentFilter& targetFilter, @@ -939,7 +939,7 @@ DOMProxyShadowsCheck GetDOMProxyShadowsCheck(); * Detect whether the internal date value is NaN. (Because failure is * out-of-band for js_DateGet*) */ -extern JS_FRIEND_API(JSBool) +extern JS_FRIEND_API(bool) js_DateIsValid(JSObject* obj); extern JS_FRIEND_API(double) @@ -1232,7 +1232,7 @@ JS_NewArrayBuffer(JSContext *cx, uint32_t nbytes); * this test or one of the JS_Is*Array tests succeeds, then it is safe to call * the various accessor JSAPI calls defined below. */ -extern JS_FRIEND_API(JSBool) +extern JS_FRIEND_API(bool) JS_IsTypedArrayObject(JSObject *obj); /* @@ -1242,30 +1242,30 @@ JS_IsTypedArrayObject(JSObject *obj); * is safe to call the various ArrayBufferView accessor JSAPI calls defined * below. */ -extern JS_FRIEND_API(JSBool) +extern JS_FRIEND_API(bool) JS_IsArrayBufferViewObject(JSObject *obj); /* * Test for specific typed array types (ArrayBufferView subtypes) */ -extern JS_FRIEND_API(JSBool) +extern JS_FRIEND_API(bool) JS_IsInt8Array(JSObject *obj); -extern JS_FRIEND_API(JSBool) +extern JS_FRIEND_API(bool) JS_IsUint8Array(JSObject *obj); -extern JS_FRIEND_API(JSBool) +extern JS_FRIEND_API(bool) JS_IsUint8ClampedArray(JSObject *obj); -extern JS_FRIEND_API(JSBool) +extern JS_FRIEND_API(bool) JS_IsInt16Array(JSObject *obj); -extern JS_FRIEND_API(JSBool) +extern JS_FRIEND_API(bool) JS_IsUint16Array(JSObject *obj); -extern JS_FRIEND_API(JSBool) +extern JS_FRIEND_API(bool) JS_IsInt32Array(JSObject *obj); -extern JS_FRIEND_API(JSBool) +extern JS_FRIEND_API(bool) JS_IsUint32Array(JSObject *obj); -extern JS_FRIEND_API(JSBool) +extern JS_FRIEND_API(bool) JS_IsFloat32Array(JSObject *obj); -extern JS_FRIEND_API(JSBool) +extern JS_FRIEND_API(bool) JS_IsFloat64Array(JSObject *obj); /* @@ -1312,7 +1312,7 @@ JS_GetArrayBufferViewType(JSObject *obj); * unwrapping. If this test succeeds, then it is safe to call the various * accessor JSAPI calls defined below. */ -extern JS_FRIEND_API(JSBool) +extern JS_FRIEND_API(bool) JS_IsArrayBufferObject(JSObject *obj); /* @@ -1373,7 +1373,7 @@ JS_GetTypedArrayByteLength(JSObject *obj); * return false if a security wrapper is encountered that denies the * unwrapping. */ -extern JS_FRIEND_API(JSBool) +extern JS_FRIEND_API(bool) JS_IsArrayBufferViewObject(JSObject *obj); /* @@ -1429,7 +1429,7 @@ JS_GetArrayBufferViewBuffer(JSObject *obj); /* * Check whether obj supports JS_GetDataView* APIs. */ -JS_FRIEND_API(JSBool) +JS_FRIEND_API(bool) JS_IsDataViewObject(JSObject *obj); /* @@ -1654,13 +1654,13 @@ NON_INTEGER_ATOM_TO_JSID(JSAtom *atom) } /* All strings stored in jsids are atomized, but are not necessarily property names. */ -static JS_ALWAYS_INLINE JSBool +static JS_ALWAYS_INLINE bool JSID_IS_ATOM(jsid id) { return JSID_IS_STRING(id); } -static JS_ALWAYS_INLINE JSBool +static JS_ALWAYS_INLINE bool JSID_IS_ATOM(jsid id, JSAtom *atom) { return id == JSID_FROM_BITS((size_t)atom); @@ -1768,7 +1768,7 @@ JS_FRIEND_API(JSObject *) GetObjectMetadata(JSObject *obj); /* ES5 8.12.8. */ -extern JS_FRIEND_API(JSBool) +extern JS_FRIEND_API(bool) DefaultValue(JSContext *cx, JS::HandleObject obj, JSType hint, MutableHandleValue vp); /* @@ -1815,11 +1815,11 @@ class AsmJSModuleSourceDesc } /* namespace js */ -extern JS_FRIEND_API(JSBool) +extern JS_FRIEND_API(bool) js_DefineOwnProperty(JSContext *cx, JSObject *objArg, jsid idArg, - const js::PropertyDescriptor& descriptor, JSBool *bp); + const js::PropertyDescriptor& descriptor, bool *bp); -extern JS_FRIEND_API(JSBool) +extern JS_FRIEND_API(bool) js_ReportIsNotFunction(JSContext *cx, const JS::Value& v); #ifdef JSGC_GENERATIONAL diff --git a/js/src/jsfun.cpp b/js/src/jsfun.cpp index fadc6a622a05b..1f61434908c97 100644 --- a/js/src/jsfun.cpp +++ b/js/src/jsfun.cpp @@ -53,7 +53,7 @@ using namespace js::frontend; using mozilla::ArrayLength; using mozilla::PodCopy; -static JSBool +static bool fun_getProperty(JSContext *cx, HandleObject obj_, HandleId id, MutableHandleValue vp) { RootedObject obj(cx, obj_); @@ -154,7 +154,7 @@ static const uint16_t poisonPillProps[] = { NAME_OFFSET(caller), }; -static JSBool +static bool fun_enumerate(JSContext *cx, HandleObject obj) { JS_ASSERT(obj->is()); @@ -234,7 +234,7 @@ ResolveInterpretedFunctionPrototype(JSContext *cx, HandleObject obj) return proto; } -JSBool +bool js::fun_resolve(JSContext *cx, HandleObject obj, HandleId id, unsigned flags, MutableHandleObject objp) { @@ -428,8 +428,8 @@ js::CloneFunctionAndScript(JSContext *cx, HandleObject enclosingScope, HandleFun * property of its 'this' parameter, and walks the prototype chain of v (only * if v is an object) returning true if .prototype is found. */ -static JSBool -fun_hasInstance(JSContext *cx, HandleObject objArg, MutableHandleValue v, JSBool *bp) +static bool +fun_hasInstance(JSContext *cx, HandleObject objArg, MutableHandleValue v, bool *bp) { RootedObject obj(cx, objArg); diff --git a/js/src/jsfun.h b/js/src/jsfun.h index ce5a8847938bc..733f658416715 100644 --- a/js/src/jsfun.h +++ b/js/src/jsfun.h @@ -411,7 +411,7 @@ DefineFunction(JSContext *cx, HandleObject obj, HandleId id, JSNative native, gc::AllocKind allocKind = JSFunction::FinalizeKind, NewObjectKind newKind = GenericObject); -extern JSBool +extern bool fun_resolve(JSContext *cx, js::HandleObject obj, js::HandleId id, unsigned flags, js::MutableHandleObject objp); diff --git a/js/src/jsgc.cpp b/js/src/jsgc.cpp index 074722a4a0db4..b1da6673dad21 100644 --- a/js/src/jsgc.cpp +++ b/js/src/jsgc.cpp @@ -930,7 +930,7 @@ InitGCZeal(JSRuntime *rt) /* Lifetime for type sets attached to scripts containing observed types. */ static const int64_t JIT_SCRIPT_RELEASE_TYPES_INTERVAL = 60 * 1000 * 1000; -JSBool +bool js_InitGC(JSRuntime *rt, uint32_t maxbytes) { InitMemorySubsystem(rt); @@ -1054,31 +1054,31 @@ AddRoot(JSContext *cx, T *rp, const char *name, JSGCRootType rootType) return ok; } -JSBool +bool js::AddValueRoot(JSContext *cx, Value *vp, const char *name) { return AddRoot(cx, vp, name, JS_GC_ROOT_VALUE_PTR); } -extern JSBool +extern bool js::AddValueRootRT(JSRuntime *rt, js::Value *vp, const char *name) { return AddRoot(rt, vp, name, JS_GC_ROOT_VALUE_PTR); } -extern JSBool +extern bool js::AddStringRoot(JSContext *cx, JSString **rp, const char *name) { return AddRoot(cx, rp, name, JS_GC_ROOT_STRING_PTR); } -extern JSBool +extern bool js::AddObjectRoot(JSContext *cx, JSObject **rp, const char *name) { return AddRoot(cx, rp, name, JS_GC_ROOT_OBJECT_PTR); } -extern JSBool +extern bool js::AddScriptRoot(JSContext *cx, JSScript **rp, const char *name) { return AddRoot(cx, rp, name, JS_GC_ROOT_SCRIPT_PTR); diff --git a/js/src/jsgc.h b/js/src/jsgc.h index 079bea86886e9..0e9d54db2bb74 100644 --- a/js/src/jsgc.h +++ b/js/src/jsgc.h @@ -653,24 +653,24 @@ typedef js::HashMap, js::SystemAllocPolicy> RootedValueMap; -extern JSBool +extern bool AddValueRoot(JSContext *cx, js::Value *vp, const char *name); -extern JSBool +extern bool AddValueRootRT(JSRuntime *rt, js::Value *vp, const char *name); -extern JSBool +extern bool AddStringRoot(JSContext *cx, JSString **rp, const char *name); -extern JSBool +extern bool AddObjectRoot(JSContext *cx, JSObject **rp, const char *name); -extern JSBool +extern bool AddScriptRoot(JSContext *cx, JSScript **rp, const char *name); } /* namespace js */ -extern JSBool +extern bool js_InitGC(JSRuntime *rt, uint32_t maxbytes); extern void diff --git a/js/src/jsiter.cpp b/js/src/jsiter.cpp index 7527806e620c6..d9861d1efd0c2 100644 --- a/js/src/jsiter.cpp +++ b/js/src/jsiter.cpp @@ -730,7 +730,7 @@ js::GetIteratorObject(JSContext *cx, HandleObject obj, uint32_t flags) return &value.toObject(); } -JSBool +bool js_ThrowStopIteration(JSContext *cx) { JS_ASSERT(!JS_IsExceptionPending(cx)); @@ -808,7 +808,7 @@ static const JSFunctionSpec iterator_methods[] = { }; static JSObject * -iterator_iteratorObject(JSContext *cx, HandleObject obj, JSBool keysonly) +iterator_iteratorObject(JSContext *cx, HandleObject obj, bool keysonly) { return obj; } @@ -957,7 +957,7 @@ const JSFunctionSpec ElementIteratorObject::methods[] = { JS_FS_END }; -static JSBool +static bool CloseGenerator(JSContext *cx, HandleObject genobj); bool @@ -1287,8 +1287,8 @@ js_IteratorNext(JSContext *cx, HandleObject iterobj, MutableHandleValue rval) return true; } -static JSBool -stopiter_hasInstance(JSContext *cx, HandleObject obj, MutableHandleValue v, JSBool *bp) +static bool +stopiter_hasInstance(JSContext *cx, HandleObject obj, MutableHandleValue v, bool *bp) { *bp = IsStopIteration(v); return true; @@ -1539,7 +1539,7 @@ typedef enum JSGeneratorOp { * Start newborn or restart yielding generator and perform the requested * operation inside its frame. */ -static JSBool +static bool SendToGenerator(JSContext *cx, JSGeneratorOp op, HandleObject obj, JSGenerator *gen, HandleValue arg) { @@ -1578,7 +1578,7 @@ SendToGenerator(JSContext *cx, JSGeneratorOp op, HandleObject obj, break; } - JSBool ok; + bool ok; { GeneratorState state(cx, gen, futureState); ok = RunScript(cx, state); @@ -1615,7 +1615,7 @@ SendToGenerator(JSContext *cx, JSGeneratorOp op, HandleObject obj, return false; } -static JSBool +static bool CloseGenerator(JSContext *cx, HandleObject obj) { JSGenerator *gen = obj->as().getGenerator(); diff --git a/js/src/jsiter.h b/js/src/jsiter.h index 977c3c7e299ee..b894a851f901f 100644 --- a/js/src/jsiter.h +++ b/js/src/jsiter.h @@ -228,7 +228,7 @@ js_IteratorMore(JSContext *cx, js::HandleObject iterobj, js::MutableHandleValue extern bool js_IteratorNext(JSContext *cx, js::HandleObject iterobj, js::MutableHandleValue rval); -extern JSBool +extern bool js_ThrowStopIteration(JSContext *cx); namespace js { diff --git a/js/src/jsmath.cpp b/js/src/jsmath.cpp index 5863e422d9932..a3347d793319b 100644 --- a/js/src/jsmath.cpp +++ b/js/src/jsmath.cpp @@ -803,7 +803,7 @@ js::math_tan(JSContext *cx, unsigned argc, Value *vp) typedef double (*UnaryMathFunctionType)(MathCache *cache, double); template -JSBool math_function(JSContext *cx, unsigned argc, Value *vp) +bool math_function(JSContext *cx, unsigned argc, Value *vp) { CallArgs args = CallArgsFromVp(argc, vp); if (args.length() == 0) { diff --git a/js/src/jsnum.cpp b/js/src/jsnum.cpp index d181e6b39128a..68238a680c523 100644 --- a/js/src/jsnum.cpp +++ b/js/src/jsnum.cpp @@ -1668,14 +1668,14 @@ js::ToUint16Slow(JSContext *cx, const HandleValue v, uint16_t *out) return true; } -JSBool +bool js_strtod(ThreadSafeContext *cx, const jschar *s, const jschar *send, const jschar **ep, double *dp) { size_t i; char cbuf[32]; char *cstr, *istr, *estr; - JSBool negative; + bool negative; double d; const jschar *s1 = SkipSpace(s, send); diff --git a/js/src/jsnum.h b/js/src/jsnum.h index 33731837446e3..68826632e692c 100644 --- a/js/src/jsnum.h +++ b/js/src/jsnum.h @@ -176,7 +176,7 @@ num_parseInt(JSContext *cx, unsigned argc, Value *vp); * If the string does not contain a number, set *ep to s and return 0.0 in dp. * Return false if out of memory. */ -extern JSBool +extern bool js_strtod(js::ThreadSafeContext *cx, const jschar *s, const jschar *send, const jschar **ep, double *dp); diff --git a/js/src/jsobj.cpp b/js/src/jsobj.cpp index 792231fb6e367..6e27a838860eb 100644 --- a/js/src/jsobj.cpp +++ b/js/src/jsobj.cpp @@ -130,7 +130,7 @@ js::InformalValueTypeName(const Value &v) } template -JSBool +bool js::HasOwnProperty(JSContext *cx, LookupGenericOp lookup, typename MaybeRooted::HandleType obj, typename MaybeRooted::HandleType id, @@ -174,12 +174,12 @@ js::HasOwnProperty(JSContext *cx, LookupGenericOp lookup, return true; } -template JSBool +template bool js::HasOwnProperty(JSContext *cx, LookupGenericOp lookup, HandleObject obj, HandleId id, MutableHandleObject objp, MutableHandleShape propp); -template JSBool +template bool js::HasOwnProperty(JSContext *cx, LookupGenericOp lookup, JSObject *obj, jsid id, FakeMutableHandle objp, FakeMutableHandle propp); @@ -525,7 +525,7 @@ js::Throw(JSContext *cx, JSObject *obj, unsigned errorNumber) return false; } -static JSBool +static bool Reject(JSContext *cx, unsigned errorNumber, bool throwError, jsid id, bool *rval) { if (throwError) @@ -535,7 +535,7 @@ Reject(JSContext *cx, unsigned errorNumber, bool throwError, jsid id, bool *rval return true; } -static JSBool +static bool Reject(JSContext *cx, JSObject *obj, unsigned errorNumber, bool throwError, bool *rval) { if (throwError) @@ -599,7 +599,7 @@ js::CheckDefineProperty(JSContext *cx, HandleObject obj, HandleId id, HandleValu return true; } -static JSBool +static bool DefinePropertyOnObject(JSContext *cx, HandleObject obj, HandleId id, const PropDesc &desc, bool throwError, bool *rval) { @@ -912,7 +912,7 @@ DefinePropertyOnObject(JSContext *cx, HandleObject obj, HandleId id, const PropD * redefining it or we had invoked its setter to change its value). */ if (callDelProperty) { - JSBool succeeded; + bool succeeded; if (!CallJSDeletePropertyOp(cx, obj2->getClass()->delProperty, obj2, id, &succeeded)) return false; } @@ -921,7 +921,7 @@ DefinePropertyOnObject(JSContext *cx, HandleObject obj, HandleId id, const PropD } /* ES6 20130308 draft 8.4.2.1 [[DefineOwnProperty]] */ -static JSBool +static bool DefinePropertyOnArray(JSContext *cx, Handle arr, HandleId id, const PropDesc &desc, bool throwError, bool *rval) { @@ -1006,9 +1006,9 @@ js::DefineProperty(JSContext *cx, HandleObject obj, HandleId id, const PropDesc return DefinePropertyOnObject(cx, obj, id, desc, throwError, rval); } -JSBool +bool js::DefineOwnProperty(JSContext *cx, HandleObject obj, HandleId id, HandleValue descriptor, - JSBool *bp) + bool *bp) { AutoPropDescArrayRooter descs(cx); PropDesc *desc = descs.append(); @@ -1022,9 +1022,9 @@ js::DefineOwnProperty(JSContext *cx, HandleObject obj, HandleId id, HandleValue return true; } -JSBool +bool js::DefineOwnProperty(JSContext *cx, HandleObject obj, HandleId id, - const PropertyDescriptor &descriptor, JSBool *bp) + const PropertyDescriptor &descriptor, bool *bp) { AutoPropDescArrayRooter descs(cx); PropDesc *desc = descs.append(); @@ -1107,7 +1107,7 @@ js::DefineProperties(JSContext *cx, HandleObject obj, HandleObject props) return true; } -extern JSBool +extern bool js_PopulateObject(JSContext *cx, HandleObject newborn, HandleObject props) { return DefineProperties(cx, newborn, props); @@ -1730,9 +1730,9 @@ js_InferFlags(JSContext *cx, unsigned defaultFlags) return flags; } -/* static */ JSBool +/* static */ bool JSObject::nonNativeSetProperty(JSContext *cx, HandleObject obj, - HandleId id, MutableHandleValue vp, JSBool strict) + HandleId id, MutableHandleValue vp, bool strict) { if (JS_UNLIKELY(obj->watched())) { WatchpointMap *wpmap = cx->compartment()->watchpointMap; @@ -1742,9 +1742,9 @@ JSObject::nonNativeSetProperty(JSContext *cx, HandleObject obj, return obj->getOps()->setGeneric(cx, obj, id, vp, strict); } -/* static */ JSBool +/* static */ bool JSObject::nonNativeSetElement(JSContext *cx, HandleObject obj, - uint32_t index, MutableHandleValue vp, JSBool strict) + uint32_t index, MutableHandleValue vp, bool strict) { if (JS_UNLIKELY(obj->watched())) { RootedId id(cx); @@ -1759,7 +1759,7 @@ JSObject::nonNativeSetElement(JSContext *cx, HandleObject obj, } /* static */ bool -JSObject::deleteByValue(JSContext *cx, HandleObject obj, const Value &property, JSBool *succeeded) +JSObject::deleteByValue(JSContext *cx, HandleObject obj, const Value &property, bool *succeeded) { uint32_t index; if (IsDefinitelyIndex(property, &index)) @@ -2384,7 +2384,7 @@ js::DefineConstructorAndPrototype(JSContext *cx, HandleObject obj, JSProtoKey ke bad: if (named) { - JSBool succeeded; + bool succeeded; JSObject::deleteByValue(cx, obj, StringValue(atom), &succeeded); } if (cached) @@ -3340,14 +3340,14 @@ js_AddNativeProperty(JSContext *cx, HandleObject obj, HandleId id, return shape; } -JSBool +bool baseops::DefineGeneric(ExclusiveContext *cx, HandleObject obj, HandleId id, HandleValue value, PropertyOp getter, StrictPropertyOp setter, unsigned attrs) { return DefineNativeProperty(cx, obj, id, value, getter, setter, attrs, 0, 0); } -/* static */ JSBool +/* static */ bool JSObject::defineGeneric(ExclusiveContext *cx, HandleObject obj, HandleId id, HandleValue value, JSPropertyOp getter, JSStrictPropertyOp setter, unsigned attrs) @@ -3362,7 +3362,7 @@ JSObject::defineGeneric(ExclusiveContext *cx, HandleObject obj, return baseops::DefineGeneric(cx, obj, id, value, getter, setter, attrs); } -/* static */ JSBool +/* static */ bool JSObject::defineProperty(ExclusiveContext *cx, HandleObject obj, PropertyName *name, HandleValue value, JSPropertyOp getter, JSStrictPropertyOp setter, unsigned attrs) @@ -3371,7 +3371,7 @@ JSObject::defineProperty(ExclusiveContext *cx, HandleObject obj, return defineGeneric(cx, obj, id, value, getter, setter, attrs); } -/* static */ JSBool +/* static */ bool JSObject::defineSpecial(ExclusiveContext *cx, HandleObject obj, SpecialId sid, HandleValue value, JSPropertyOp getter, JSStrictPropertyOp setter, unsigned attrs) @@ -3380,7 +3380,7 @@ JSObject::defineSpecial(ExclusiveContext *cx, HandleObject obj, return defineGeneric(cx, obj, id, value, getter, setter, attrs); } -JSBool +bool baseops::DefineElement(ExclusiveContext *cx, HandleObject obj, uint32_t index, HandleValue value, PropertyOp getter, StrictPropertyOp setter, unsigned attrs) { @@ -3398,7 +3398,7 @@ baseops::DefineElement(ExclusiveContext *cx, HandleObject obj, uint32_t index, H return DefineNativeProperty(cx, obj, id, value, getter, setter, attrs, 0, 0); } -/* static */ JSBool +/* static */ bool JSObject::defineElement(ExclusiveContext *cx, HandleObject obj, uint32_t index, HandleValue value, JSPropertyOp getter, JSStrictPropertyOp setter, unsigned attrs) @@ -3691,7 +3691,7 @@ js::DefineNativeProperty(ExclusiveContext *cx, HandleObject obj, HandleId id, Ha * - Otherwise no property was resolved. Set *propp = NULL and *recursedp = false * and return true. */ -static JS_ALWAYS_INLINE JSBool +static JS_ALWAYS_INLINE bool CallResolveOp(JSContext *cx, HandleObject obj, HandleId id, unsigned flags, MutableHandleObject objp, MutableHandleShape propp, bool *recursedp) { @@ -3847,7 +3847,7 @@ LookupPropertyWithFlagsInline(ExclusiveContext *cx, } template -JSBool +bool baseops::LookupProperty(ExclusiveContext *cx, typename MaybeRooted::HandleType obj, typename MaybeRooted::HandleType id, @@ -3863,16 +3863,16 @@ baseops::LookupProperty(ExclusiveContext *cx, return LookupPropertyWithFlagsInline(cx, obj, id, resolveFlags, objp, propp); } -template JSBool +template bool baseops::LookupProperty(ExclusiveContext *cx, HandleObject obj, HandleId id, MutableHandleObject objp, MutableHandleShape propp); -template JSBool +template bool baseops::LookupProperty(ExclusiveContext *cx, JSObject *obj, jsid id, FakeMutableHandle objp, FakeMutableHandle propp); -/* static */ JSBool +/* static */ bool JSObject::lookupGeneric(JSContext *cx, HandleObject obj, js::HandleId id, MutableHandleObject objp, MutableHandleShape propp) { @@ -3887,7 +3887,7 @@ JSObject::lookupGeneric(JSContext *cx, HandleObject obj, js::HandleId id, return baseops::LookupProperty(cx, obj, id, objp, propp); } -JSBool +bool baseops::LookupElement(JSContext *cx, HandleObject obj, uint32_t index, MutableHandleObject objp, MutableHandleShape propp) { @@ -3973,7 +3973,7 @@ js::LookupNameWithGlobalDefault(JSContext *cx, HandlePropertyName name, HandleOb } template -static JS_ALWAYS_INLINE JSBool +static JS_ALWAYS_INLINE bool NativeGetInline(JSContext *cx, typename MaybeRooted::HandleType obj, typename MaybeRooted::HandleType receiver, @@ -4038,7 +4038,7 @@ NativeGetInline(JSContext *cx, return true; } -JSBool +bool js_NativeGet(JSContext *cx, Handle obj, Handle pobj, Handle shape, unsigned getHow, MutableHandle vp) { @@ -4046,7 +4046,7 @@ js_NativeGet(JSContext *cx, Handle obj, Handle pobj, Handl } -JSBool +bool js_NativeSet(JSContext *cx, Handle obj, Handle receiver, HandleShape shape, bool strict, MutableHandleValue vp) { @@ -4094,7 +4094,7 @@ js_NativeSet(JSContext *cx, Handle obj, Handle receiver, } template -static JS_ALWAYS_INLINE JSBool +static JS_ALWAYS_INLINE bool GetPropertyHelperInline(JSContext *cx, typename MaybeRooted::HandleType obj, typename MaybeRooted::HandleType receiver, @@ -4209,14 +4209,14 @@ js::GetPropertyHelper(JSContext *cx, HandleObject obj, HandleId id, uint32_t get return GetPropertyHelperInline(cx, obj, obj, id, getHow, vp); } -JSBool +bool baseops::GetProperty(JSContext *cx, HandleObject obj, HandleObject receiver, HandleId id, MutableHandleValue vp) { /* This call site is hot -- use the always-inlined variant of GetPropertyHelper(). */ return GetPropertyHelperInline(cx, obj, receiver, id, 0, vp); } -JSBool +bool baseops::GetPropertyNoGC(JSContext *cx, JSObject *obj, JSObject *receiver, jsid id, Value *vp) { AutoAssertNoException nogc(cx); @@ -4396,7 +4396,7 @@ js::GetObjectElementOperationPure(ThreadSafeContext *cx, JSObject *obj, const Va return GetPropertyPure(cx, obj, NameToId(name->asPropertyName()), vp); } -JSBool +bool baseops::GetElement(JSContext *cx, HandleObject obj, HandleObject receiver, uint32_t index, MutableHandleValue vp) { @@ -4408,7 +4408,7 @@ baseops::GetElement(JSContext *cx, HandleObject obj, HandleObject receiver, uint return GetPropertyHelperInline(cx, obj, receiver, id, 0, vp); } -JSBool +bool baseops::GetPropertyDefault(JSContext *cx, HandleObject obj, HandleId id, HandleValue def, MutableHandleValue vp) { @@ -4528,9 +4528,9 @@ JSObject::callMethod(JSContext *cx, HandleId id, unsigned argc, Value *argv, Mut return Invoke(cx, ObjectValue(*obj), fval, argc, argv, vp); } -JSBool +bool baseops::SetPropertyHelper(JSContext *cx, HandleObject obj, HandleObject receiver, HandleId id, - unsigned defineHow, MutableHandleValue vp, JSBool strict) + unsigned defineHow, MutableHandleValue vp, bool strict) { JS_ASSERT((defineHow & ~DNP_UNQUALIFIED) == 0); @@ -4706,9 +4706,9 @@ baseops::SetPropertyHelper(JSContext *cx, HandleObject obj, HandleObject receive return js_NativeSet(cx, obj, receiver, shape, strict, vp); } -JSBool +bool baseops::SetElementHelper(JSContext *cx, HandleObject obj, HandleObject receiver, uint32_t index, - unsigned defineHow, MutableHandleValue vp, JSBool strict) + unsigned defineHow, MutableHandleValue vp, bool strict) { RootedId id(cx); if (!IndexToId(cx, index, &id)) @@ -4716,7 +4716,7 @@ baseops::SetElementHelper(JSContext *cx, HandleObject obj, HandleObject receiver return baseops::SetPropertyHelper(cx, obj, receiver, id, defineHow, vp, strict); } -JSBool +bool baseops::GetAttributes(JSContext *cx, HandleObject obj, HandleId id, unsigned *attrsp) { RootedObject nobj(cx); @@ -4734,7 +4734,7 @@ baseops::GetAttributes(JSContext *cx, HandleObject obj, HandleId id, unsigned *a return true; } -JSBool +bool baseops::GetElementAttributes(JSContext *cx, HandleObject obj, uint32_t index, unsigned *attrsp) { RootedObject nobj(cx); @@ -4752,7 +4752,7 @@ baseops::GetElementAttributes(JSContext *cx, HandleObject obj, uint32_t index, u return true; } -JSBool +bool baseops::SetAttributes(JSContext *cx, HandleObject obj, HandleId id, unsigned *attrsp) { RootedObject nobj(cx); @@ -4771,7 +4771,7 @@ baseops::SetAttributes(JSContext *cx, HandleObject obj, HandleId id, unsigned *a : JSObject::setGenericAttributes(cx, nobj, id, attrsp); } -JSBool +bool baseops::SetElementAttributes(JSContext *cx, HandleObject obj, uint32_t index, unsigned *attrsp) { RootedObject nobj(cx); @@ -4791,8 +4791,8 @@ baseops::SetElementAttributes(JSContext *cx, HandleObject obj, uint32_t index, u : JSObject::setElementAttributes(cx, nobj, index, attrsp); } -JSBool -baseops::DeleteGeneric(JSContext *cx, HandleObject obj, HandleId id, JSBool *succeeded) +bool +baseops::DeleteGeneric(JSContext *cx, HandleObject obj, HandleId id, bool *succeeded) { RootedObject proto(cx); RootedShape shape(cx); @@ -4835,16 +4835,16 @@ baseops::DeleteGeneric(JSContext *cx, HandleObject obj, HandleId id, JSBool *suc return obj->removeProperty(cx, id) && js_SuppressDeletedProperty(cx, obj, id); } -JSBool +bool baseops::DeleteProperty(JSContext *cx, HandleObject obj, HandlePropertyName name, - JSBool *succeeded) + bool *succeeded) { Rooted id(cx, NameToId(name)); return baseops::DeleteGeneric(cx, obj, id, succeeded); } -JSBool -baseops::DeleteElement(JSContext *cx, HandleObject obj, uint32_t index, JSBool *succeeded) +bool +baseops::DeleteElement(JSContext *cx, HandleObject obj, uint32_t index, bool *succeeded) { RootedId id(cx); if (!IndexToId(cx, index, &id)) @@ -4852,8 +4852,8 @@ baseops::DeleteElement(JSContext *cx, HandleObject obj, uint32_t index, JSBool * return baseops::DeleteGeneric(cx, obj, id, succeeded); } -JSBool -baseops::DeleteSpecial(JSContext *cx, HandleObject obj, HandleSpecialId sid, JSBool *succeeded) +bool +baseops::DeleteSpecial(JSContext *cx, HandleObject obj, HandleSpecialId sid, bool *succeeded) { Rooted id(cx, SPECIALID_TO_JSID(sid)); return baseops::DeleteGeneric(cx, obj, id, succeeded); @@ -4897,7 +4897,7 @@ MaybeCallMethod(JSContext *cx, HandleObject obj, HandleId id, MutableHandleValue return Invoke(cx, ObjectValue(*obj), vp, 0, NULL, vp); } -JS_FRIEND_API(JSBool) +JS_FRIEND_API(bool) js::DefaultValue(JSContext *cx, HandleObject obj, JSType hint, MutableHandleValue vp) { JS_ASSERT(hint == JSTYPE_NUMBER || hint == JSTYPE_STRING || hint == JSTYPE_VOID); @@ -4975,7 +4975,7 @@ js::DefaultValue(JSContext *cx, HandleObject obj, JSType hint, MutableHandleValu return false; } -JS_FRIEND_API(JSBool) +JS_FRIEND_API(bool) JS_EnumerateState(JSContext *cx, HandleObject obj, JSIterateOp enum_op, MutableHandleValue statep, JS::MutableHandleId idp) { @@ -4996,11 +4996,11 @@ JS_EnumerateState(JSContext *cx, HandleObject obj, JSIterateOp enum_op, return true; } -JSBool +bool js::CheckAccess(JSContext *cx, JSObject *obj_, HandleId id, JSAccessMode mode, MutableHandleValue vp, unsigned *attrsp) { - JSBool writing; + bool writing; RootedObject obj(cx, obj_), pobj(cx); while (JS_UNLIKELY(obj->is())) @@ -5161,7 +5161,7 @@ PrimitiveToObject(JSContext *cx, const Value &v) return BooleanObject::create(cx, v.toBoolean()); } -JSBool +bool js_PrimitiveToObject(JSContext *cx, Value *vp) { JSObject *obj = PrimitiveToObject(cx, *vp); @@ -5172,7 +5172,7 @@ js_PrimitiveToObject(JSContext *cx, Value *vp) return true; } -JSBool +bool js_ValueToObjectOrNull(JSContext *cx, const Value &v, MutableHandleObject objp) { JSObject *obj; @@ -5266,7 +5266,7 @@ js_GetObjectSlotName(JSTracer *trc, char *buf, size_t bufsize) } } -JSBool +bool js_ReportGetterOnlyAssignment(JSContext *cx, bool strict) { return JS_ReportErrorFlagsAndNumber(cx, @@ -5277,8 +5277,8 @@ js_ReportGetterOnlyAssignment(JSContext *cx, bool strict) JSMSG_GETTER_ONLY); } -JS_FRIEND_API(JSBool) -js_GetterOnlyPropertyStub(JSContext *cx, HandleObject obj, HandleId id, JSBool strict, +JS_FRIEND_API(bool) +js_GetterOnlyPropertyStub(JSContext *cx, HandleObject obj, HandleId id, bool strict, MutableHandleValue vp) { JS_ReportErrorNumber(cx, js_GetErrorMessage, NULL, JSMSG_GETTER_ONLY); diff --git a/js/src/jsobj.h b/js/src/jsobj.h index 4a2e19958fed3..b8c5c680799ba 100644 --- a/js/src/jsobj.h +++ b/js/src/jsobj.h @@ -98,91 +98,91 @@ namespace baseops { * return true with both *objp and *propp null. */ template -extern JSBool +extern bool LookupProperty(ExclusiveContext *cx, typename MaybeRooted::HandleType obj, typename MaybeRooted::HandleType id, typename MaybeRooted::MutableHandleType objp, typename MaybeRooted::MutableHandleType propp); -extern JSBool +extern bool LookupElement(JSContext *cx, HandleObject obj, uint32_t index, MutableHandleObject objp, MutableHandleShape propp); -extern JSBool +extern bool DefineGeneric(ExclusiveContext *cx, HandleObject obj, HandleId id, HandleValue value, JSPropertyOp getter, JSStrictPropertyOp setter, unsigned attrs); -extern JSBool +extern bool DefineElement(ExclusiveContext *cx, HandleObject obj, uint32_t index, HandleValue value, JSPropertyOp getter, JSStrictPropertyOp setter, unsigned attrs); -extern JSBool +extern bool GetProperty(JSContext *cx, HandleObject obj, HandleObject receiver, HandleId id, MutableHandleValue vp); -extern JSBool +extern bool GetPropertyNoGC(JSContext *cx, JSObject *obj, JSObject *receiver, jsid id, Value *vp); -extern JSBool +extern bool GetElement(JSContext *cx, HandleObject obj, HandleObject receiver, uint32_t index, MutableHandleValue vp); -inline JSBool +inline bool GetProperty(JSContext *cx, HandleObject obj, HandleId id, MutableHandleValue vp) { return GetProperty(cx, obj, obj, id, vp); } -inline JSBool +inline bool GetElement(JSContext *cx, HandleObject obj, uint32_t index, MutableHandleValue vp) { return GetElement(cx, obj, obj, index, vp); } -extern JSBool +extern bool GetPropertyDefault(JSContext *cx, HandleObject obj, HandleId id, HandleValue def, MutableHandleValue vp); -extern JSBool +extern bool SetPropertyHelper(JSContext *cx, HandleObject obj, HandleObject receiver, HandleId id, - unsigned defineHow, MutableHandleValue vp, JSBool strict); + unsigned defineHow, MutableHandleValue vp, bool strict); inline bool SetPropertyHelper(JSContext *cx, HandleObject obj, HandleObject receiver, PropertyName *name, - unsigned defineHow, MutableHandleValue vp, JSBool strict) + unsigned defineHow, MutableHandleValue vp, bool strict) { Rooted id(cx, NameToId(name)); return SetPropertyHelper(cx, obj, receiver, id, defineHow, vp, strict); } -extern JSBool +extern bool SetElementHelper(JSContext *cx, HandleObject obj, HandleObject Receiver, uint32_t index, - unsigned defineHow, MutableHandleValue vp, JSBool strict); + unsigned defineHow, MutableHandleValue vp, bool strict); extern JSType TypeOf(JSContext *cx, HandleObject obj); -extern JSBool +extern bool GetAttributes(JSContext *cx, HandleObject obj, HandleId id, unsigned *attrsp); -extern JSBool +extern bool SetAttributes(JSContext *cx, HandleObject obj, HandleId id, unsigned *attrsp); -extern JSBool +extern bool GetElementAttributes(JSContext *cx, HandleObject obj, uint32_t index, unsigned *attrsp); -extern JSBool +extern bool SetElementAttributes(JSContext *cx, HandleObject obj, uint32_t index, unsigned *attrsp); -extern JSBool -DeleteProperty(JSContext *cx, HandleObject obj, HandlePropertyName name, JSBool *succeeded); +extern bool +DeleteProperty(JSContext *cx, HandleObject obj, HandlePropertyName name, bool *succeeded); -extern JSBool -DeleteElement(JSContext *cx, HandleObject obj, uint32_t index, JSBool *succeeded); +extern bool +DeleteElement(JSContext *cx, HandleObject obj, uint32_t index, bool *succeeded); -extern JSBool -DeleteSpecial(JSContext *cx, HandleObject obj, HandleSpecialId sid, JSBool *succeeded); +extern bool +DeleteSpecial(JSContext *cx, HandleObject obj, HandleSpecialId sid, bool *succeeded); -extern JSBool -DeleteGeneric(JSContext *cx, HandleObject obj, HandleId id, JSBool *succeeded); +extern bool +DeleteGeneric(JSContext *cx, HandleObject obj, HandleId id, bool *succeeded); } /* namespace js::baseops */ @@ -757,56 +757,56 @@ class JSObject : public js::ObjectImpl /* Clear the scope, making it empty. */ static void clear(JSContext *cx, js::HandleObject obj); - static JSBool lookupGeneric(JSContext *cx, js::HandleObject obj, js::HandleId id, - js::MutableHandleObject objp, js::MutableHandleShape propp); + static bool lookupGeneric(JSContext *cx, js::HandleObject obj, js::HandleId id, + js::MutableHandleObject objp, js::MutableHandleShape propp); - static JSBool lookupProperty(JSContext *cx, js::HandleObject obj, js::PropertyName *name, - js::MutableHandleObject objp, js::MutableHandleShape propp) + static bool lookupProperty(JSContext *cx, js::HandleObject obj, js::PropertyName *name, + js::MutableHandleObject objp, js::MutableHandleShape propp) { JS::RootedId id(cx, js::NameToId(name)); return lookupGeneric(cx, obj, id, objp, propp); } - static JSBool lookupElement(JSContext *cx, js::HandleObject obj, uint32_t index, - js::MutableHandleObject objp, js::MutableHandleShape propp) + static bool lookupElement(JSContext *cx, js::HandleObject obj, uint32_t index, + js::MutableHandleObject objp, js::MutableHandleShape propp) { js::LookupElementOp op = obj->getOps()->lookupElement; return (op ? op : js::baseops::LookupElement)(cx, obj, index, objp, propp); } - static JSBool lookupSpecial(JSContext *cx, js::HandleObject obj, js::SpecialId sid, - js::MutableHandleObject objp, js::MutableHandleShape propp) + static bool lookupSpecial(JSContext *cx, js::HandleObject obj, js::SpecialId sid, + js::MutableHandleObject objp, js::MutableHandleShape propp) { JS::RootedId id(cx, SPECIALID_TO_JSID(sid)); return lookupGeneric(cx, obj, id, objp, propp); } - static JSBool defineGeneric(js::ExclusiveContext *cx, js::HandleObject obj, - js::HandleId id, js::HandleValue value, - JSPropertyOp getter = JS_PropertyStub, - JSStrictPropertyOp setter = JS_StrictPropertyStub, - unsigned attrs = JSPROP_ENUMERATE); - - static JSBool defineProperty(js::ExclusiveContext *cx, js::HandleObject obj, - js::PropertyName *name, js::HandleValue value, - JSPropertyOp getter = JS_PropertyStub, - JSStrictPropertyOp setter = JS_StrictPropertyStub, - unsigned attrs = JSPROP_ENUMERATE); - - static JSBool defineElement(js::ExclusiveContext *cx, js::HandleObject obj, - uint32_t index, js::HandleValue value, - JSPropertyOp getter = JS_PropertyStub, - JSStrictPropertyOp setter = JS_StrictPropertyStub, - unsigned attrs = JSPROP_ENUMERATE); - - static JSBool defineSpecial(js::ExclusiveContext *cx, js::HandleObject obj, - js::SpecialId sid, js::HandleValue value, - JSPropertyOp getter = JS_PropertyStub, - JSStrictPropertyOp setter = JS_StrictPropertyStub, - unsigned attrs = JSPROP_ENUMERATE); - - static JSBool getGeneric(JSContext *cx, js::HandleObject obj, js::HandleObject receiver, - js::HandleId id, js::MutableHandleValue vp) + static bool defineGeneric(js::ExclusiveContext *cx, js::HandleObject obj, + js::HandleId id, js::HandleValue value, + JSPropertyOp getter = JS_PropertyStub, + JSStrictPropertyOp setter = JS_StrictPropertyStub, + unsigned attrs = JSPROP_ENUMERATE); + + static bool defineProperty(js::ExclusiveContext *cx, js::HandleObject obj, + js::PropertyName *name, js::HandleValue value, + JSPropertyOp getter = JS_PropertyStub, + JSStrictPropertyOp setter = JS_StrictPropertyStub, + unsigned attrs = JSPROP_ENUMERATE); + + static bool defineElement(js::ExclusiveContext *cx, js::HandleObject obj, + uint32_t index, js::HandleValue value, + JSPropertyOp getter = JS_PropertyStub, + JSStrictPropertyOp setter = JS_StrictPropertyStub, + unsigned attrs = JSPROP_ENUMERATE); + + static bool defineSpecial(js::ExclusiveContext *cx, js::HandleObject obj, + js::SpecialId sid, js::HandleValue value, + JSPropertyOp getter = JS_PropertyStub, + JSStrictPropertyOp setter = JS_StrictPropertyStub, + unsigned attrs = JSPROP_ENUMERATE); + + static bool getGeneric(JSContext *cx, js::HandleObject obj, js::HandleObject receiver, + js::HandleId id, js::MutableHandleValue vp) { js::GenericIdOp op = obj->getOps()->getGeneric; if (op) { @@ -819,8 +819,8 @@ class JSObject : public js::ObjectImpl return true; } - static JSBool getGenericNoGC(JSContext *cx, JSObject *obj, JSObject *receiver, - jsid id, js::Value *vp) + static bool getGenericNoGC(JSContext *cx, JSObject *obj, JSObject *receiver, + jsid id, js::Value *vp) { js::GenericIdOp op = obj->getOps()->getGeneric; if (op) @@ -828,120 +828,120 @@ class JSObject : public js::ObjectImpl return js::baseops::GetPropertyNoGC(cx, obj, receiver, id, vp); } - static JSBool getProperty(JSContext *cx, js::HandleObject obj, js::HandleObject receiver, - js::PropertyName *name, js::MutableHandleValue vp) + static bool getProperty(JSContext *cx, js::HandleObject obj, js::HandleObject receiver, + js::PropertyName *name, js::MutableHandleValue vp) { JS::RootedId id(cx, js::NameToId(name)); return getGeneric(cx, obj, receiver, id, vp); } - static JSBool getPropertyNoGC(JSContext *cx, JSObject *obj, JSObject *receiver, - js::PropertyName *name, js::Value *vp) + static bool getPropertyNoGC(JSContext *cx, JSObject *obj, JSObject *receiver, + js::PropertyName *name, js::Value *vp) { return getGenericNoGC(cx, obj, receiver, js::NameToId(name), vp); } - static inline JSBool getElement(JSContext *cx, js::HandleObject obj, js::HandleObject receiver, - uint32_t index, js::MutableHandleValue vp); - static inline JSBool getElementNoGC(JSContext *cx, JSObject *obj, JSObject *receiver, - uint32_t index, js::Value *vp); + static inline bool getElement(JSContext *cx, js::HandleObject obj, js::HandleObject receiver, + uint32_t index, js::MutableHandleValue vp); + static inline bool getElementNoGC(JSContext *cx, JSObject *obj, JSObject *receiver, + uint32_t index, js::Value *vp); /* If element is not present (e.g. array hole) *present is set to false and the contents of *vp are unusable garbage. */ - static inline JSBool getElementIfPresent(JSContext *cx, js::HandleObject obj, - js::HandleObject receiver, uint32_t index, - js::MutableHandleValue vp, bool *present); + static inline bool getElementIfPresent(JSContext *cx, js::HandleObject obj, + js::HandleObject receiver, uint32_t index, + js::MutableHandleValue vp, bool *present); - static JSBool getSpecial(JSContext *cx, js::HandleObject obj, - js::HandleObject receiver, js::SpecialId sid, - js::MutableHandleValue vp) + static bool getSpecial(JSContext *cx, js::HandleObject obj, + js::HandleObject receiver, js::SpecialId sid, + js::MutableHandleValue vp) { JS::RootedId id(cx, SPECIALID_TO_JSID(sid)); return getGeneric(cx, obj, receiver, id, vp); } - static JSBool setGeneric(JSContext *cx, js::HandleObject obj, js::HandleObject receiver, - js::HandleId id, js::MutableHandleValue vp, JSBool strict) + static bool setGeneric(JSContext *cx, js::HandleObject obj, js::HandleObject receiver, + js::HandleId id, js::MutableHandleValue vp, bool strict) { if (obj->getOps()->setGeneric) return nonNativeSetProperty(cx, obj, id, vp, strict); return js::baseops::SetPropertyHelper(cx, obj, receiver, id, 0, vp, strict); } - static JSBool setProperty(JSContext *cx, js::HandleObject obj, js::HandleObject receiver, - js::PropertyName *name, - js::MutableHandleValue vp, JSBool strict) + static bool setProperty(JSContext *cx, js::HandleObject obj, js::HandleObject receiver, + js::PropertyName *name, + js::MutableHandleValue vp, bool strict) { JS::RootedId id(cx, js::NameToId(name)); return setGeneric(cx, obj, receiver, id, vp, strict); } - static JSBool setElement(JSContext *cx, js::HandleObject obj, js::HandleObject receiver, - uint32_t index, js::MutableHandleValue vp, JSBool strict) + static bool setElement(JSContext *cx, js::HandleObject obj, js::HandleObject receiver, + uint32_t index, js::MutableHandleValue vp, bool strict) { if (obj->getOps()->setElement) return nonNativeSetElement(cx, obj, index, vp, strict); return js::baseops::SetElementHelper(cx, obj, receiver, index, 0, vp, strict); } - static JSBool setSpecial(JSContext *cx, js::HandleObject obj, js::HandleObject receiver, - js::SpecialId sid, js::MutableHandleValue vp, JSBool strict) + static bool setSpecial(JSContext *cx, js::HandleObject obj, js::HandleObject receiver, + js::SpecialId sid, js::MutableHandleValue vp, bool strict) { JS::RootedId id(cx, SPECIALID_TO_JSID(sid)); return setGeneric(cx, obj, receiver, id, vp, strict); } - static JSBool nonNativeSetProperty(JSContext *cx, js::HandleObject obj, - js::HandleId id, js::MutableHandleValue vp, JSBool strict); - static JSBool nonNativeSetElement(JSContext *cx, js::HandleObject obj, - uint32_t index, js::MutableHandleValue vp, JSBool strict); + static bool nonNativeSetProperty(JSContext *cx, js::HandleObject obj, + js::HandleId id, js::MutableHandleValue vp, bool strict); + static bool nonNativeSetElement(JSContext *cx, js::HandleObject obj, + uint32_t index, js::MutableHandleValue vp, bool strict); - static JSBool getGenericAttributes(JSContext *cx, js::HandleObject obj, - js::HandleId id, unsigned *attrsp) + static bool getGenericAttributes(JSContext *cx, js::HandleObject obj, + js::HandleId id, unsigned *attrsp) { js::GenericAttributesOp op = obj->getOps()->getGenericAttributes; return (op ? op : js::baseops::GetAttributes)(cx, obj, id, attrsp); } - static JSBool getPropertyAttributes(JSContext *cx, js::HandleObject obj, - js::PropertyName *name, unsigned *attrsp) + static bool getPropertyAttributes(JSContext *cx, js::HandleObject obj, + js::PropertyName *name, unsigned *attrsp) { JS::RootedId id(cx, js::NameToId(name)); return getGenericAttributes(cx, obj, id, attrsp); } - static inline JSBool getElementAttributes(JSContext *cx, js::HandleObject obj, - uint32_t index, unsigned *attrsp); + static inline bool getElementAttributes(JSContext *cx, js::HandleObject obj, + uint32_t index, unsigned *attrsp); - static JSBool getSpecialAttributes(JSContext *cx, js::HandleObject obj, - js::SpecialId sid, unsigned *attrsp) + static bool getSpecialAttributes(JSContext *cx, js::HandleObject obj, + js::SpecialId sid, unsigned *attrsp) { JS::RootedId id(cx, SPECIALID_TO_JSID(sid)); return getGenericAttributes(cx, obj, id, attrsp); } - static inline JSBool setGenericAttributes(JSContext *cx, js::HandleObject obj, - js::HandleId id, unsigned *attrsp); - static inline JSBool setPropertyAttributes(JSContext *cx, js::HandleObject obj, - js::PropertyName *name, unsigned *attrsp); - static inline JSBool setElementAttributes(JSContext *cx, js::HandleObject obj, - uint32_t index, unsigned *attrsp); - static inline JSBool setSpecialAttributes(JSContext *cx, js::HandleObject obj, - js::SpecialId sid, unsigned *attrsp); + static inline bool setGenericAttributes(JSContext *cx, js::HandleObject obj, + js::HandleId id, unsigned *attrsp); + static inline bool setPropertyAttributes(JSContext *cx, js::HandleObject obj, + js::PropertyName *name, unsigned *attrsp); + static inline bool setElementAttributes(JSContext *cx, js::HandleObject obj, + uint32_t index, unsigned *attrsp); + static inline bool setSpecialAttributes(JSContext *cx, js::HandleObject obj, + js::SpecialId sid, unsigned *attrsp); static inline bool deleteProperty(JSContext *cx, js::HandleObject obj, js::HandlePropertyName name, - JSBool *succeeded); + bool *succeeded); static inline bool deleteElement(JSContext *cx, js::HandleObject obj, - uint32_t index, JSBool *succeeded); + uint32_t index, bool *succeeded); static inline bool deleteSpecial(JSContext *cx, js::HandleObject obj, - js::HandleSpecialId sid, JSBool *succeeded); + js::HandleSpecialId sid, bool *succeeded); static bool deleteByValue(JSContext *cx, js::HandleObject obj, - const js::Value &property, JSBool *succeeded); + const js::Value &property, bool *succeeded); static bool enumerate(JSContext *cx, JS::HandleObject obj, JSIterateOp iterop, - JS::MutableHandleValue statep, JS::MutableHandleId idp) + JS::MutableHandleValue statep, JS::MutableHandleId idp) { JSNewEnumerateOp op = obj->getOps()->enumerate; return (op ? op : JS_EnumerateState)(cx, obj, iterop, statep, idp); @@ -1095,7 +1095,7 @@ class ValueArray { namespace js { template -extern JSBool +extern bool HasOwnProperty(JSContext *cx, LookupGenericOp lookup, typename MaybeRooted::HandleType obj, typename MaybeRooted::HandleType id, @@ -1126,7 +1126,7 @@ extern const char js_lookupGetter_str[]; extern const char js_lookupSetter_str[]; #endif -extern JSBool +extern bool js_PopulateObject(JSContext *cx, js::HandleObject newborn, js::HandleObject props); /* @@ -1162,13 +1162,13 @@ js_AddNativeProperty(JSContext *cx, JS::HandleObject obj, JS::HandleId id, namespace js { -extern JSBool +extern bool DefineOwnProperty(JSContext *cx, JS::HandleObject obj, JS::HandleId id, - JS::HandleValue descriptor, JSBool *bp); + JS::HandleValue descriptor, bool *bp); -extern JSBool +extern bool DefineOwnProperty(JSContext *cx, JS::HandleObject obj, JS::HandleId id, - const js::PropertyDescriptor &descriptor, JSBool *bp); + const js::PropertyDescriptor &descriptor, bool *bp); /* * The NewObjectKind allows an allocation site to specify the type properties @@ -1310,11 +1310,11 @@ js_FindVariableScope(JSContext *cx, JSFunction **funp); * scope is again locked. But on failure, both functions return false with the * scope containing shape unlocked. */ -extern JSBool +extern bool js_NativeGet(JSContext *cx, js::Handle obj, js::Handle pobj, js::Handle shape, unsigned getHow, js::MutableHandle vp); -extern JSBool +extern bool js_NativeSet(JSContext *cx, js::Handle obj, js::Handle receiver, js::Handle shape, bool strict, js::MutableHandleValue vp); @@ -1364,7 +1364,7 @@ HasDataProperty(JSContext *cx, JSObject *obj, PropertyName *name, Value *vp) return HasDataProperty(cx, obj, NameToId(name), vp); } -extern JSBool +extern bool CheckAccess(JSContext *cx, JSObject *obj, HandleId id, JSAccessMode mode, MutableHandleValue v, unsigned *attrsp); @@ -1380,10 +1380,10 @@ GetObjectElementOperationPure(ThreadSafeContext *cx, JSObject *obj, const Value * Wrap boolean, number or string as Boolean, Number or String object. * *vp must not be an object, null or undefined. */ -extern JSBool +extern bool js_PrimitiveToObject(JSContext *cx, js::Value *vp); -extern JSBool +extern bool js_ValueToObjectOrNull(JSContext *cx, const js::Value &v, JS::MutableHandleObject objp); /* Throws if v could not be converted to an object. */ @@ -1426,7 +1426,7 @@ CloneObjectLiteral(JSContext *cx, HandleObject parent, HandleObject srcObj); extern void js_GetObjectSlotName(JSTracer *trc, char *buf, size_t bufsize); -extern JSBool +extern bool js_ReportGetterOnlyAssignment(JSContext *cx, bool strict); extern unsigned diff --git a/js/src/jsobjinlines.h b/js/src/jsobjinlines.h index ca84c9912eb26..3f979dda5f5dd 100644 --- a/js/src/jsobjinlines.h +++ b/js/src/jsobjinlines.h @@ -23,7 +23,7 @@ #include "vm/ObjectImpl-inl.h" #include "vm/Shape-inl.h" -/* static */ inline JSBool +/* static */ inline bool JSObject::setGenericAttributes(JSContext *cx, js::HandleObject obj, js::HandleId id, unsigned *attrsp) { @@ -32,7 +32,7 @@ JSObject::setGenericAttributes(JSContext *cx, js::HandleObject obj, return (op ? op : js::baseops::SetAttributes)(cx, obj, id, attrsp); } -/* static */ inline JSBool +/* static */ inline bool JSObject::setPropertyAttributes(JSContext *cx, js::HandleObject obj, js::PropertyName *name, unsigned *attrsp) { @@ -40,7 +40,7 @@ JSObject::setPropertyAttributes(JSContext *cx, js::HandleObject obj, return setGenericAttributes(cx, obj, id, attrsp); } -/* static */ inline JSBool +/* static */ inline bool JSObject::setElementAttributes(JSContext *cx, js::HandleObject obj, uint32_t index, unsigned *attrsp) { @@ -48,7 +48,7 @@ JSObject::setElementAttributes(JSContext *cx, js::HandleObject obj, return (op ? op : js::baseops::SetElementAttributes)(cx, obj, index, attrsp); } -/* static */ inline JSBool +/* static */ inline bool JSObject::setSpecialAttributes(JSContext *cx, js::HandleObject obj, js::SpecialId sid, unsigned *attrsp) { @@ -65,7 +65,7 @@ JSObject::changePropertyAttributes(JSContext *cx, js::HandleObject obj, /* static */ inline bool JSObject::deleteProperty(JSContext *cx, js::HandleObject obj, js::HandlePropertyName name, - JSBool *succeeded) + bool *succeeded) { JS::RootedId id(cx, js::NameToId(name)); js::types::AddTypePropertyId(cx, obj, id, js::types::Type::UndefinedType()); @@ -75,7 +75,7 @@ JSObject::deleteProperty(JSContext *cx, js::HandleObject obj, js::HandleProperty } /* static */ inline bool -JSObject::deleteElement(JSContext *cx, js::HandleObject obj, uint32_t index, JSBool *succeeded) +JSObject::deleteElement(JSContext *cx, js::HandleObject obj, uint32_t index, bool *succeeded) { JS::RootedId id(cx); if (!js::IndexToId(cx, index, &id)) @@ -88,7 +88,7 @@ JSObject::deleteElement(JSContext *cx, js::HandleObject obj, uint32_t index, JSB /* static */ inline bool JSObject::deleteSpecial(JSContext *cx, js::HandleObject obj, js::HandleSpecialId sid, - JSBool *succeeded) + bool *succeeded) { JS::RootedId id(cx, SPECIALID_TO_JSID(sid)); js::types::AddTypePropertyId(cx, obj, id, js::types::Type::UndefinedType()); @@ -690,7 +690,7 @@ JSObject::nativeSetSlotWithType(js::ExclusiveContext *cx, js::HandleObject obj, js::types::AddTypePropertyId(cx, obj, shape->propid(), value); } -/* static */ inline JSBool +/* static */ inline bool JSObject::getElement(JSContext *cx, js::HandleObject obj, js::HandleObject receiver, uint32_t index, js::MutableHandleValue vp) { @@ -704,7 +704,7 @@ JSObject::getElement(JSContext *cx, js::HandleObject obj, js::HandleObject recei return getGeneric(cx, obj, receiver, id, vp); } -/* static */ inline JSBool +/* static */ inline bool JSObject::getElementNoGC(JSContext *cx, JSObject *obj, JSObject *receiver, uint32_t index, js::Value *vp) { @@ -718,7 +718,7 @@ JSObject::getElementNoGC(JSContext *cx, JSObject *obj, JSObject *receiver, return getGenericNoGC(cx, obj, receiver, id, vp); } -/* static */ inline JSBool +/* static */ inline bool JSObject::getElementIfPresent(JSContext *cx, js::HandleObject obj, js::HandleObject receiver, uint32_t index, js::MutableHandleValue vp, bool *present) @@ -750,7 +750,7 @@ JSObject::getElementIfPresent(JSContext *cx, js::HandleObject obj, js::HandleObj return getGeneric(cx, obj, receiver, id, vp); } -/* static */ inline JSBool +/* static */ inline bool JSObject::getElementAttributes(JSContext *cx, js::HandleObject obj, uint32_t index, unsigned *attrsp) { @@ -1235,7 +1235,7 @@ LookupProperty(ExclusiveContext *cx, HandleObject obj, PropertyName *name, return LookupProperty(cx, obj, id, objp, propp); } -inline JSBool +inline bool DefineProperty(ExclusiveContext *cx, HandleObject obj, PropertyName *name, HandleValue value, JSPropertyOp getter, JSStrictPropertyOp setter, unsigned attrs) { diff --git a/js/src/json.cpp b/js/src/json.cpp index e916d251c4a4f..32f100082c228 100644 --- a/js/src/json.cpp +++ b/js/src/json.cpp @@ -135,9 +135,9 @@ class StringifyContext uint32_t depth; }; -static JSBool Str(JSContext *cx, const Value &v, StringifyContext *scx); +static bool Str(JSContext *cx, const Value &v, StringifyContext *scx); -static JSBool +static bool WriteIndent(JSContext *cx, StringifyContext *scx, uint32_t limit) { if (!scx->gap.empty()) { @@ -265,7 +265,7 @@ IsFilteredValue(const Value &v) } /* ES5 15.12.3 JO. */ -static JSBool +static bool JO(JSContext *cx, HandleObject obj, StringifyContext *scx) { /* @@ -355,7 +355,7 @@ JO(JSContext *cx, HandleObject obj, StringifyContext *scx) } /* ES5 15.12.3 JA. */ -static JSBool +static bool JA(JSContext *cx, HandleObject obj, StringifyContext *scx) { /* @@ -429,7 +429,7 @@ JA(JSContext *cx, HandleObject obj, StringifyContext *scx) return scx->sb.append(']'); } -static JSBool +static bool Str(JSContext *cx, const Value &v, StringifyContext *scx) { /* Step 11 must be handled by the caller. */ @@ -481,7 +481,7 @@ Str(JSContext *cx, const Value &v, StringifyContext *scx) RootedObject obj(cx, &v.toObject()); scx->depth++; - JSBool ok; + bool ok; if (ObjectClassIs(obj, ESClass_Array, cx)) ok = JA(cx, obj, scx); else @@ -492,7 +492,7 @@ Str(JSContext *cx, const Value &v, StringifyContext *scx) } /* ES5 15.12.3. */ -JSBool +bool js_Stringify(JSContext *cx, MutableHandleValue vp, JSObject *replacer_, Value space_, StringBuffer &sb) { @@ -691,7 +691,7 @@ Walk(JSContext *cx, HandleObject holder, HandleId name, HandleValue reviver, Mut if (newElement.isUndefined()) { /* Step 2a(iii)(2). */ - JSBool succeeded; + bool succeeded; if (!JSObject::deleteByValue(cx, obj, IdToValue(id), &succeeded)) return false; } else { @@ -720,7 +720,7 @@ Walk(JSContext *cx, HandleObject holder, HandleId name, HandleValue reviver, Mut if (newElement.isUndefined()) { /* Step 2b(ii)(2). */ - JSBool succeeded; + bool succeeded; if (!JSObject::deleteByValue(cx, obj, IdToValue(id), &succeeded)) return false; } else { diff --git a/js/src/json.h b/js/src/json.h index ba26e88f700bd..973ead7813d73 100644 --- a/js/src/json.h +++ b/js/src/json.h @@ -16,7 +16,7 @@ extern JSObject * js_InitJSONClass(JSContext *cx, js::HandleObject obj); -extern JSBool +extern bool js_Stringify(JSContext *cx, js::MutableHandleValue vp, JSObject *replacer, js::Value space, js::StringBuffer &sb); diff --git a/js/src/jsopcode.cpp b/js/src/jsopcode.cpp index 19adaa99de6d8..d389e2f8132f4 100644 --- a/js/src/jsopcode.cpp +++ b/js/src/jsopcode.cpp @@ -326,8 +326,8 @@ js_DumpPCCounts(JSContext *cx, HandleScript script, js::Sprinter *sp) * If pc != NULL, include a prefix indicating whether the PC is at the current line. * If showAll is true, include the source note type and the entry stack depth. */ -JS_FRIEND_API(JSBool) -js_DisassembleAtPC(JSContext *cx, JSScript *scriptArg, JSBool lines, +JS_FRIEND_API(bool) +js_DisassembleAtPC(JSContext *cx, JSScript *scriptArg, bool lines, jsbytecode *pc, bool showAll, Sprinter *sp) { RootedScript script(cx, scriptArg); @@ -394,13 +394,13 @@ js_DisassembleAtPC(JSContext *cx, JSScript *scriptArg, JSBool lines, return true; } -JSBool -js_Disassemble(JSContext *cx, HandleScript script, JSBool lines, Sprinter *sp) +bool +js_Disassemble(JSContext *cx, HandleScript script, bool lines, Sprinter *sp) { return js_DisassembleAtPC(cx, script, lines, NULL, false, sp); } -JS_FRIEND_API(JSBool) +JS_FRIEND_API(bool) js_DumpPC(JSContext *cx) { js::gc::AutoSuppressGC suppressGC(cx); @@ -409,12 +409,12 @@ js_DumpPC(JSContext *cx) return false; ScriptFrameIter iter(cx); RootedScript script(cx, iter.script()); - JSBool ok = js_DisassembleAtPC(cx, script, true, iter.pc(), false, &sprinter); + bool ok = js_DisassembleAtPC(cx, script, true, iter.pc(), false, &sprinter); fprintf(stdout, "%s", sprinter.string()); return ok; } -JS_FRIEND_API(JSBool) +JS_FRIEND_API(bool) js_DumpScript(JSContext *cx, JSScript *scriptArg) { js::gc::AutoSuppressGC suppressGC(cx); @@ -422,7 +422,7 @@ js_DumpScript(JSContext *cx, JSScript *scriptArg) if (!sprinter.init()) return false; RootedScript script(cx, scriptArg); - JSBool ok = js_Disassemble(cx, script, true, &sprinter); + bool ok = js_Disassemble(cx, script, true, &sprinter); fprintf(stdout, "%s", sprinter.string()); return ok; } @@ -430,7 +430,7 @@ js_DumpScript(JSContext *cx, JSScript *scriptArg) /* * Useful to debug ReconstructPCStack. */ -JS_FRIEND_API(JSBool) +JS_FRIEND_API(bool) js_DumpScriptDepth(JSContext *cx, JSScript *scriptArg, jsbytecode *pc) { js::gc::AutoSuppressGC suppressGC(cx); @@ -438,7 +438,7 @@ js_DumpScriptDepth(JSContext *cx, JSScript *scriptArg, jsbytecode *pc) if (!sprinter.init()) return false; RootedScript script(cx, scriptArg); - JSBool ok = js_DisassembleAtPC(cx, script, true, pc, true, &sprinter); + bool ok = js_DisassembleAtPC(cx, script, true, pc, true, &sprinter); fprintf(stdout, "%s", sprinter.string()); return ok; } @@ -527,7 +527,7 @@ ToDisassemblySource(JSContext *cx, jsval v, JSAutoByteString *bytes) unsigned js_Disassemble1(JSContext *cx, HandleScript script, jsbytecode *pc, - unsigned loc, JSBool lines, Sprinter *sp) + unsigned loc, bool lines, Sprinter *sp) { JSOp op = (JSOp)*pc; if (op >= JSOP_LIMIT) { @@ -981,7 +981,7 @@ static char * QuoteString(Sprinter *sp, JSString *str, uint32_t quote) { /* Sample off first for later return value pointer computation. */ - JSBool dontEscape = (quote & DONT_ESCAPE) != 0; + bool dontEscape = (quote & DONT_ESCAPE) != 0; jschar qc = (jschar) quote; ptrdiff_t offset = sp->getOffset(); if (qc && Sprint(sp, "%c", (char)qc) < 0) diff --git a/js/src/jsopcode.h b/js/src/jsopcode.h index a935b8288732c..d435211b80630 100644 --- a/js/src/jsopcode.h +++ b/js/src/jsopcode.h @@ -784,12 +784,12 @@ GetNextPc(jsbytecode *pc) /* * Disassemblers, for debugging only. */ -JSBool -js_Disassemble(JSContext *cx, JS::Handle script, JSBool lines, js::Sprinter *sp); +bool +js_Disassemble(JSContext *cx, JS::Handle script, bool lines, js::Sprinter *sp); unsigned js_Disassemble1(JSContext *cx, JS::Handle script, jsbytecode *pc, unsigned loc, - JSBool lines, js::Sprinter *sp); + bool lines, js::Sprinter *sp); #endif diff --git a/js/src/jsproxy.cpp b/js/src/jsproxy.cpp index ee1df97431bc6..9a7d84996559c 100644 --- a/js/src/jsproxy.cpp +++ b/js/src/jsproxy.cpp @@ -470,7 +470,7 @@ DirectProxyHandler::hasInstance(JSContext *cx, HandleObject proxy, MutableHandle bool *bp) { assertEnteredPolicy(cx, proxy, JSID_VOID); - JSBool b; + bool b; RootedObject target(cx, proxy->as().target()); if (!JS_HasInstance(cx, target, v, &b)) return false; @@ -538,7 +538,7 @@ DirectProxyHandler::has(JSContext *cx, HandleObject proxy, HandleId id, bool *bp { assertEnteredPolicy(cx, proxy, id); JS_ASSERT(!hasPrototype()); // Should never be called if there's a prototype. - JSBool found; + bool found; RootedObject target(cx, proxy->as().target()); if (!JS_HasPropertyById(cx, target, id, &found)) return false; @@ -2448,7 +2448,7 @@ Proxy::has(JSContext *cx, HandleObject proxy, HandleId id, bool *bp) return false; if (*bp) return true; - JSBool Bp; + bool Bp; INVOKE_ON_PROTOTYPE(cx, handler, proxy, JS_HasPropertyById(cx, proto, id, &Bp) && ((*bp = Bp) || true)); @@ -2740,7 +2740,7 @@ proxy_innerObject(JSContext *cx, HandleObject obj) return obj->as().private_().toObjectOrNull(); } -static JSBool +static bool proxy_LookupGeneric(JSContext *cx, HandleObject obj, HandleId id, MutableHandleObject objp, MutableHandleShape propp) { @@ -2758,7 +2758,7 @@ proxy_LookupGeneric(JSContext *cx, HandleObject obj, HandleId id, return true; } -static JSBool +static bool proxy_LookupProperty(JSContext *cx, HandleObject obj, HandlePropertyName name, MutableHandleObject objp, MutableHandleShape propp) { @@ -2766,7 +2766,7 @@ proxy_LookupProperty(JSContext *cx, HandleObject obj, HandlePropertyName name, return proxy_LookupGeneric(cx, obj, id, objp, propp); } -static JSBool +static bool proxy_LookupElement(JSContext *cx, HandleObject obj, uint32_t index, MutableHandleObject objp, MutableHandleShape propp) { @@ -2776,7 +2776,7 @@ proxy_LookupElement(JSContext *cx, HandleObject obj, uint32_t index, return proxy_LookupGeneric(cx, obj, id, objp, propp); } -static JSBool +static bool proxy_LookupSpecial(JSContext *cx, HandleObject obj, HandleSpecialId sid, MutableHandleObject objp, MutableHandleShape propp) { @@ -2784,7 +2784,7 @@ proxy_LookupSpecial(JSContext *cx, HandleObject obj, HandleSpecialId sid, return proxy_LookupGeneric(cx, obj, id, objp, propp); } -static JSBool +static bool proxy_DefineGeneric(JSContext *cx, HandleObject obj, HandleId id, HandleValue value, PropertyOp getter, StrictPropertyOp setter, unsigned attrs) { @@ -2798,7 +2798,7 @@ proxy_DefineGeneric(JSContext *cx, HandleObject obj, HandleId id, HandleValue va return Proxy::defineProperty(cx, obj, id, &desc); } -static JSBool +static bool proxy_DefineProperty(JSContext *cx, HandleObject obj, HandlePropertyName name, HandleValue value, PropertyOp getter, StrictPropertyOp setter, unsigned attrs) { @@ -2806,7 +2806,7 @@ proxy_DefineProperty(JSContext *cx, HandleObject obj, HandlePropertyName name, H return proxy_DefineGeneric(cx, obj, id, value, getter, setter, attrs); } -static JSBool +static bool proxy_DefineElement(JSContext *cx, HandleObject obj, uint32_t index, HandleValue value, PropertyOp getter, StrictPropertyOp setter, unsigned attrs) { @@ -2816,7 +2816,7 @@ proxy_DefineElement(JSContext *cx, HandleObject obj, uint32_t index, HandleValue return proxy_DefineGeneric(cx, obj, id, value, getter, setter, attrs); } -static JSBool +static bool proxy_DefineSpecial(JSContext *cx, HandleObject obj, HandleSpecialId sid, HandleValue value, PropertyOp getter, StrictPropertyOp setter, unsigned attrs) { @@ -2824,14 +2824,14 @@ proxy_DefineSpecial(JSContext *cx, HandleObject obj, HandleSpecialId sid, Handle return proxy_DefineGeneric(cx, obj, id, value, getter, setter, attrs); } -static JSBool +static bool proxy_GetGeneric(JSContext *cx, HandleObject obj, HandleObject receiver, HandleId id, MutableHandleValue vp) { return Proxy::get(cx, obj, receiver, id, vp); } -static JSBool +static bool proxy_GetProperty(JSContext *cx, HandleObject obj, HandleObject receiver, HandlePropertyName name, MutableHandleValue vp) { @@ -2839,7 +2839,7 @@ proxy_GetProperty(JSContext *cx, HandleObject obj, HandleObject receiver, Handle return proxy_GetGeneric(cx, obj, receiver, id, vp); } -static JSBool +static bool proxy_GetElement(JSContext *cx, HandleObject obj, HandleObject receiver, uint32_t index, MutableHandleValue vp) { @@ -2849,14 +2849,14 @@ proxy_GetElement(JSContext *cx, HandleObject obj, HandleObject receiver, uint32_ return proxy_GetGeneric(cx, obj, receiver, id, vp); } -static JSBool +static bool proxy_GetElementIfPresent(JSContext *cx, HandleObject obj, HandleObject receiver, uint32_t index, MutableHandleValue vp, bool *present) { return Proxy::getElementIfPresent(cx, obj, receiver, index, vp, present); } -static JSBool +static bool proxy_GetSpecial(JSContext *cx, HandleObject obj, HandleObject receiver, HandleSpecialId sid, MutableHandleValue vp) { @@ -2864,24 +2864,24 @@ proxy_GetSpecial(JSContext *cx, HandleObject obj, HandleObject receiver, HandleS return proxy_GetGeneric(cx, obj, receiver, id, vp); } -static JSBool +static bool proxy_SetGeneric(JSContext *cx, HandleObject obj, HandleId id, - MutableHandleValue vp, JSBool strict) + MutableHandleValue vp, bool strict) { return Proxy::set(cx, obj, obj, id, strict, vp); } -static JSBool +static bool proxy_SetProperty(JSContext *cx, HandleObject obj, HandlePropertyName name, - MutableHandleValue vp, JSBool strict) + MutableHandleValue vp, bool strict) { Rooted id(cx, NameToId(name)); return proxy_SetGeneric(cx, obj, id, vp, strict); } -static JSBool +static bool proxy_SetElement(JSContext *cx, HandleObject obj, uint32_t index, - MutableHandleValue vp, JSBool strict) + MutableHandleValue vp, bool strict) { RootedId id(cx); if (!IndexToId(cx, index, &id)) @@ -2889,15 +2889,15 @@ proxy_SetElement(JSContext *cx, HandleObject obj, uint32_t index, return proxy_SetGeneric(cx, obj, id, vp, strict); } -static JSBool +static bool proxy_SetSpecial(JSContext *cx, HandleObject obj, HandleSpecialId sid, - MutableHandleValue vp, JSBool strict) + MutableHandleValue vp, bool strict) { Rooted id(cx, SPECIALID_TO_JSID(sid)); return proxy_SetGeneric(cx, obj, id, vp, strict); } -static JSBool +static bool proxy_GetGenericAttributes(JSContext *cx, HandleObject obj, HandleId id, unsigned *attrsp) { AutoPropertyDescriptorRooter desc(cx); @@ -2907,14 +2907,14 @@ proxy_GetGenericAttributes(JSContext *cx, HandleObject obj, HandleId id, unsigne return true; } -static JSBool +static bool proxy_GetPropertyAttributes(JSContext *cx, HandleObject obj, HandlePropertyName name, unsigned *attrsp) { Rooted id(cx, NameToId(name)); return proxy_GetGenericAttributes(cx, obj, id, attrsp); } -static JSBool +static bool proxy_GetElementAttributes(JSContext *cx, HandleObject obj, uint32_t index, unsigned *attrsp) { RootedId id(cx); @@ -2923,14 +2923,14 @@ proxy_GetElementAttributes(JSContext *cx, HandleObject obj, uint32_t index, unsi return proxy_GetGenericAttributes(cx, obj, id, attrsp); } -static JSBool +static bool proxy_GetSpecialAttributes(JSContext *cx, HandleObject obj, HandleSpecialId sid, unsigned *attrsp) { Rooted id(cx, SPECIALID_TO_JSID(sid)); return proxy_GetGenericAttributes(cx, obj, id, attrsp); } -static JSBool +static bool proxy_SetGenericAttributes(JSContext *cx, HandleObject obj, HandleId id, unsigned *attrsp) { /* Lookup the current property descriptor so we have setter/getter/value. */ @@ -2941,14 +2941,14 @@ proxy_SetGenericAttributes(JSContext *cx, HandleObject obj, HandleId id, unsigne return Proxy::defineProperty(cx, obj, id, &desc); } -static JSBool +static bool proxy_SetPropertyAttributes(JSContext *cx, HandleObject obj, HandlePropertyName name, unsigned *attrsp) { Rooted id(cx, NameToId(name)); return proxy_SetGenericAttributes(cx, obj, id, attrsp); } -static JSBool +static bool proxy_SetElementAttributes(JSContext *cx, HandleObject obj, uint32_t index, unsigned *attrsp) { RootedId id(cx); @@ -2957,15 +2957,15 @@ proxy_SetElementAttributes(JSContext *cx, HandleObject obj, uint32_t index, unsi return proxy_SetGenericAttributes(cx, obj, id, attrsp); } -static JSBool +static bool proxy_SetSpecialAttributes(JSContext *cx, HandleObject obj, HandleSpecialId sid, unsigned *attrsp) { Rooted id(cx, SPECIALID_TO_JSID(sid)); return proxy_SetGenericAttributes(cx, obj, id, attrsp); } -static JSBool -proxy_DeleteGeneric(JSContext *cx, HandleObject obj, HandleId id, JSBool *succeeded) +static bool +proxy_DeleteGeneric(JSContext *cx, HandleObject obj, HandleId id, bool *succeeded) { bool deleted; if (!Proxy::delete_(cx, obj, id, &deleted)) @@ -2974,15 +2974,15 @@ proxy_DeleteGeneric(JSContext *cx, HandleObject obj, HandleId id, JSBool *succee return js_SuppressDeletedProperty(cx, obj, id); } -static JSBool -proxy_DeleteProperty(JSContext *cx, HandleObject obj, HandlePropertyName name, JSBool *succeeded) +static bool +proxy_DeleteProperty(JSContext *cx, HandleObject obj, HandlePropertyName name, bool *succeeded) { Rooted id(cx, NameToId(name)); return proxy_DeleteGeneric(cx, obj, id, succeeded); } -static JSBool -proxy_DeleteElement(JSContext *cx, HandleObject obj, uint32_t index, JSBool *succeeded) +static bool +proxy_DeleteElement(JSContext *cx, HandleObject obj, uint32_t index, bool *succeeded) { RootedId id(cx); if (!IndexToId(cx, index, &id)) @@ -2990,8 +2990,8 @@ proxy_DeleteElement(JSContext *cx, HandleObject obj, uint32_t index, JSBool *suc return proxy_DeleteGeneric(cx, obj, id, succeeded); } -static JSBool -proxy_DeleteSpecial(JSContext *cx, HandleObject obj, HandleSpecialId sid, JSBool *succeeded) +static bool +proxy_DeleteSpecial(JSContext *cx, HandleObject obj, HandleSpecialId sid, bool *succeeded) { Rooted id(cx, SPECIALID_TO_JSID(sid)); return proxy_DeleteGeneric(cx, obj, id, succeeded); @@ -3048,7 +3048,7 @@ proxy_WeakmapKeyDelegate(JSObject *obj) return obj->as().handler()->weakmapKeyDelegate(obj); } -static JSBool +static bool proxy_Convert(JSContext *cx, HandleObject proxy, JSType hint, MutableHandleValue vp) { JS_ASSERT(proxy->is()); @@ -3062,8 +3062,8 @@ proxy_Finalize(FreeOp *fop, JSObject *obj) obj->as().handler()->finalize(fop, obj); } -static JSBool -proxy_HasInstance(JSContext *cx, HandleObject proxy, MutableHandleValue v, JSBool *bp) +static bool +proxy_HasInstance(JSContext *cx, HandleObject proxy, MutableHandleValue v, bool *bp) { bool b; if (!Proxy::hasInstance(cx, proxy, v, &b)) diff --git a/js/src/jsprvtd.h b/js/src/jsprvtd.h index 1fbc086a7c79f..254010c1ceb4a 100644 --- a/js/src/jsprvtd.h +++ b/js/src/jsprvtd.h @@ -250,7 +250,7 @@ typedef JSTrapStatus (* JSThrowHook)(JSContext *cx, JSScript *script, jsbytecode *pc, jsval *rval, void *closure); -typedef JSBool +typedef bool (* JSWatchPointHandler)(JSContext *cx, JSObject *obj, jsid id, jsval old, jsval *newp, void *closure); @@ -291,7 +291,7 @@ typedef JSObject * * iterator object or null if an error or exception was thrown on cx. */ typedef JSObject * -(* JSIteratorOp)(JSContext *cx, JS::HandleObject obj, JSBool keysonly); +(* JSIteratorOp)(JSContext *cx, JS::HandleObject obj, bool keysonly); #endif /* jsprvtd_h */ diff --git a/js/src/jspubtd.h b/js/src/jspubtd.h index fde81c1795b2a..b280fbfbf1e7c 100644 --- a/js/src/jspubtd.h +++ b/js/src/jspubtd.h @@ -200,11 +200,11 @@ class JSStableString; // long story class JSString; #ifdef JS_THREADSAFE -typedef struct PRCallOnceType JSCallOnceType; +typedef struct PRCallOnceType JSCallOnceType; #else -typedef JSBool JSCallOnceType; +typedef bool JSCallOnceType; #endif -typedef JSBool (*JSInitCallback)(void); +typedef bool (*JSInitCallback)(void); namespace JS { namespace shadow { diff --git a/js/src/jsstr.cpp b/js/src/jsstr.cpp index 86b609c3a3d22..2502a3415ee8c 100644 --- a/js/src/jsstr.cpp +++ b/js/src/jsstr.cpp @@ -364,7 +364,7 @@ const JSSubString js_EmptySubString = {0, js_empty_ucstr}; static const unsigned STRING_ELEMENT_ATTRS = JSPROP_ENUMERATE | JSPROP_READONLY | JSPROP_PERMANENT; -static JSBool +static bool str_enumerate(JSContext *cx, HandleObject obj) { RootedString str(cx, obj->as().unbox()); @@ -764,7 +764,7 @@ js_toUpperCase(JSContext *cx, JSString *str) return str; } -static JSBool +static bool ToUpperCaseHelper(JSContext *cx, CallReceiver call) { RootedString str(cx, ThisToStringForStringProto(cx, call)); @@ -1488,8 +1488,8 @@ str_endsWith(JSContext *cx, unsigned argc, Value *vp) return true; } -static JSBool -js_TrimString(JSContext *cx, Value *vp, JSBool trimLeft, JSBool trimRight) +static bool +js_TrimString(JSContext *cx, Value *vp, bool trimLeft, bool trimRight) { CallReceiver call = CallReceiverFromVp(vp); RootedString str(cx, ThisToStringForStringProto(cx, call)); @@ -3361,7 +3361,7 @@ tagify(JSContext *cx, const char *begin, HandleLinearString param, const char *e return true; } -static JSBool +static bool tagify_value(JSContext *cx, CallArgs args, const char *begin, const char *end) { RootedLinearString param(cx, ArgToRootedString(cx, args, 0)); diff --git a/js/src/jstypes.h b/js/src/jstypes.h index fe300897b86f3..3388af88c04ba 100644 --- a/js/src/jstypes.h +++ b/js/src/jstypes.h @@ -180,16 +180,6 @@ # error "Implement me" #endif - -/************************************************************************ -** TYPES: JSBool -** DESCRIPTION: -** This type is deprecated; avoid it. See bug 898914. -************************************************************************/ -typedef int JSBool; -#define JS_TRUE_DEPRECATED (int)1 -#define JS_FALSE_DEPRECATED (int)0 - /*********************************************************************** ** MACROS: JS_LIKELY ** JS_UNLIKELY diff --git a/js/src/jsweakmap.cpp b/js/src/jsweakmap.cpp index e7e8daf1b5b56..4cfc8b2016f30 100644 --- a/js/src/jsweakmap.cpp +++ b/js/src/jsweakmap.cpp @@ -327,7 +327,7 @@ WeakMap_set(JSContext *cx, unsigned argc, Value *vp) return CallNonGenericMethod(cx, args); } -JS_FRIEND_API(JSBool) +JS_FRIEND_API(bool) JS_NondeterministicGetWeakMapKeys(JSContext *cx, JSObject *objArg, JSObject **ret) { RootedObject obj(cx, objArg); diff --git a/js/src/jswrapper.cpp b/js/src/jswrapper.cpp index 41f13f9ffbe10..986d7d17597bf 100644 --- a/js/src/jswrapper.cpp +++ b/js/src/jswrapper.cpp @@ -853,7 +853,7 @@ js::NukeCrossCompartmentWrapper(JSContext *cx, JSObject *wrapper) * and only do that on tab close (outer window destruction). Thus the * option of how to handle the global object. */ -JS_FRIEND_API(JSBool) +JS_FRIEND_API(bool) js::NukeCrossCompartmentWrappers(JSContext* cx, const CompartmentFilter& sourceFilter, const CompartmentFilter& targetFilter, diff --git a/js/src/perf/jsperf.cpp b/js/src/perf/jsperf.cpp index dc1617e1af5b4..775c412fe68c8 100644 --- a/js/src/perf/jsperf.cpp +++ b/js/src/perf/jsperf.cpp @@ -18,7 +18,7 @@ static PerfMeasurement* GetPMFromThis(JSContext* cx, jsval* vp); // Property access #define GETTER(name) \ - static JSBool \ + static bool \ pm_get_##name(JSContext* cx, JS::HandleObject obj, JS::HandleId /*unused*/, JS::MutableHandleValue vp) \ { \ PerfMeasurement* p = GetPM(cx, obj, #name); \ diff --git a/js/src/shell/js.cpp b/js/src/shell/js.cpp index 9fe894fd400f8..97e5f261cda65 100644 --- a/js/src/shell/js.cpp +++ b/js/src/shell/js.cpp @@ -126,7 +126,7 @@ static bool enableAsmJS = true; static bool printTiming = false; -static JSBool +static bool SetTimeoutValue(JSContext *cx, double t); static bool @@ -344,7 +344,7 @@ GetContextData(JSContext *cx) return data; } -static JSBool +static bool ShellOperationCallback(JSContext *cx) { if (!gTimedOut) @@ -780,7 +780,7 @@ Options(JSContext *cx, unsigned argc, jsval *vp) return true; } -static JSBool +static bool LoadScript(JSContext *cx, unsigned argc, jsval *vp, bool scriptRelative) { CallArgs args = CallArgsFromVp(argc, vp); @@ -937,7 +937,7 @@ Evaluate(JSContext *cx, unsigned argc, jsval *vp) if (!JS_GetProperty(cx, opts, "newContext", &v)) return false; if (!JSVAL_IS_VOID(v)) { - JSBool b; + bool b; if (!JS_ValueToBoolean(cx, v, &b)) return false; newContext = b; @@ -946,7 +946,7 @@ Evaluate(JSContext *cx, unsigned argc, jsval *vp) if (!JS_GetProperty(cx, opts, "compileAndGo", &v)) return false; if (!JSVAL_IS_VOID(v)) { - JSBool b; + bool b; if (!JS_ValueToBoolean(cx, v, &b)) return false; compileAndGo = b; @@ -955,7 +955,7 @@ Evaluate(JSContext *cx, unsigned argc, jsval *vp) if (!JS_GetProperty(cx, opts, "noScriptRval", &v)) return false; if (!JSVAL_IS_VOID(v)) { - JSBool b; + bool b; if (!JS_ValueToBoolean(cx, v, &b)) return false; noScriptRval = b; @@ -1015,7 +1015,7 @@ Evaluate(JSContext *cx, unsigned argc, jsval *vp) if (!JS_GetProperty(cx, opts, "catchTermination", &v)) return false; if (!JSVAL_IS_VOID(v)) { - JSBool b; + bool b; if (!JS_ValueToBoolean(cx, v, &b)) return false; catchTermination = b; @@ -1024,7 +1024,7 @@ Evaluate(JSContext *cx, unsigned argc, jsval *vp) if (!JS_GetProperty(cx, opts, "saveFrameChain", &v)) return false; if (!JSVAL_IS_VOID(v)) { - JSBool b; + bool b; if (!JS_ValueToBoolean(cx, v, &b)) return false; saveFrameChain = b; @@ -1328,7 +1328,7 @@ Now(JSContext *cx, unsigned argc, jsval *vp) return true; } -static JSBool +static bool PrintInternal(JSContext *cx, const CallArgs &args, FILE *file) { for (unsigned i = 0; i < args.length(); i++) { @@ -1407,7 +1407,7 @@ AssertEq(JSContext *cx, unsigned argc, jsval *vp) return false; } - JSBool same; + bool same; if (!JS_SameValue(cx, args[0], args[1], &same)) return false; if (!same) { @@ -1484,7 +1484,7 @@ SetDebug(JSContext *cx, unsigned argc, jsval *vp) return ok; } -static JSBool +static bool GetScriptAndPCArgs(JSContext *cx, unsigned argc, jsval *argv, MutableHandleScript scriptp, int32_t *ip) { @@ -1847,7 +1847,7 @@ JS_STATIC_ASSERT(JSTRY_ITER == 2); static const char* const TryNoteNames[] = { "catch", "finally", "iter", "loop" }; -static JSBool +static bool TryNotes(JSContext *cx, HandleScript script, Sprinter *sp) { JSTryNote *tn, *tnlimit; @@ -2459,11 +2459,11 @@ typedef struct ComplexObject { JSObject *outer; } ComplexObject; -static JSBool +static bool sandbox_enumerate(JSContext *cx, HandleObject obj) { RootedValue v(cx); - JSBool b; + bool b; if (!JS_GetProperty(cx, obj, "lazy", &v)) return false; @@ -2472,12 +2472,12 @@ sandbox_enumerate(JSContext *cx, HandleObject obj) return !b || JS_EnumerateStandardClasses(cx, obj); } -static JSBool +static bool sandbox_resolve(JSContext *cx, HandleObject obj, HandleId id, unsigned flags, MutableHandleObject objp) { RootedValue v(cx); - JSBool b, resolved; + bool b, resolved; if (!JS_GetProperty(cx, obj, "lazy", &v)) return false; @@ -2674,7 +2674,7 @@ ShapeOf(JSContext *cx, unsigned argc, JS::Value *vp) * Since obj is native, this isn't totally transparent; properties of a * non-native referent may be simplified to data properties. */ -static JSBool +static bool CopyProperty(JSContext *cx, HandleObject obj, HandleObject referent, HandleId id, unsigned lookupFlags, MutableHandleObject objp) { @@ -2734,7 +2734,7 @@ CopyProperty(JSContext *cx, HandleObject obj, HandleObject referent, HandleId id desc.attrs, propFlags, desc.shortid); } -static JSBool +static bool resolver_resolve(JSContext *cx, HandleObject obj, HandleId id, unsigned flags, MutableHandleObject objp) { @@ -2743,7 +2743,7 @@ resolver_resolve(JSContext *cx, HandleObject obj, HandleId id, unsigned flags, return CopyProperty(cx, obj, vobj, id, flags, objp); } -static JSBool +static bool resolver_enumerate(JSContext *cx, HandleObject obj) { jsval v = JS_GetReservedSlot(obj, 0); @@ -3044,7 +3044,7 @@ CancelExecution(JSRuntime *rt) } } -static JSBool +static bool SetTimeoutValue(JSContext *cx, double t) { /* NB: The next condition also filter out NaNs. */ @@ -3309,7 +3309,7 @@ struct FreeOnReturn } }; -static JSBool +static bool ReadFile(JSContext *cx, unsigned argc, jsval *vp, bool scriptRelative) { CallArgs args = CallArgsFromVp(argc, vp); @@ -3336,7 +3336,7 @@ ReadFile(JSContext *cx, unsigned argc, jsval *vp, bool scriptRelative) JSString *opt = JS_ValueToString(cx, args[1]); if (!opt) return false; - JSBool match; + bool match; if (!JS_StringEqualsAscii(cx, opt, "binary", &match)) return false; if (match) { @@ -4086,11 +4086,11 @@ enum its_tinyid { ITS_CUSTOM, ITS_CUSTOMRDONLY, ITS_CUSTOMNATIVE }; -static JSBool +static bool its_getter(JSContext *cx, HandleObject obj, HandleId id, MutableHandleValue vp); -static JSBool -its_setter(JSContext *cx, HandleObject obj, HandleId id, JSBool strict, MutableHandleValue vp); +static bool +its_setter(JSContext *cx, HandleObject obj, HandleId id, bool strict, MutableHandleValue vp); static bool its_get_customNative(JSContext *cx, unsigned argc, jsval *vp); @@ -4116,10 +4116,10 @@ static const JSPropertySpec its_props[] = { {NULL,0,0,JSOP_NULLWRAPPER, JSOP_NULLWRAPPER} }; -static JSBool its_noisy; /* whether to be noisy when finalizing it */ -static JSBool its_enum_fail;/* whether to fail when enumerating it */ +static bool its_noisy; /* whether to be noisy when finalizing it */ +static bool its_enum_fail;/* whether to fail when enumerating it */ -static JSBool +static bool its_addProperty(JSContext *cx, HandleObject obj, HandleId id, MutableHandleValue vp) { if (!its_noisy) @@ -4132,8 +4132,8 @@ its_addProperty(JSContext *cx, HandleObject obj, HandleId id, MutableHandleValue return true; } -static JSBool -its_delProperty(JSContext *cx, HandleObject obj, HandleId id, JSBool *succeeded) +static bool +its_delProperty(JSContext *cx, HandleObject obj, HandleId id, bool *succeeded) { if (!its_noisy) { *succeeded = true; @@ -4150,7 +4150,7 @@ its_delProperty(JSContext *cx, HandleObject obj, HandleId id, JSBool *succeeded) return true; } -static JSBool +static bool its_getProperty(JSContext *cx, HandleObject obj, HandleId id, MutableHandleValue vp) { if (!its_noisy) @@ -4163,8 +4163,8 @@ its_getProperty(JSContext *cx, HandleObject obj, HandleId id, MutableHandleValue return true; } -static JSBool -its_setProperty(JSContext *cx, HandleObject obj, HandleId id, JSBool strict, MutableHandleValue vp) +static bool +its_setProperty(JSContext *cx, HandleObject obj, HandleId id, bool strict, MutableHandleValue vp) { ToStringHelper idString(cx, id); if (its_noisy) { @@ -4188,7 +4188,7 @@ its_setProperty(JSContext *cx, HandleObject obj, HandleId id, JSBool strict, Mut * Its enumerator, implemented using the "new" enumerate API, * see class flags. */ -static JSBool +static bool its_enumerate(JSContext *cx, HandleObject obj, JSIterateOp enum_op, jsval *statep, jsid *idp) { @@ -4232,7 +4232,7 @@ its_enumerate(JSContext *cx, HandleObject obj, JSIterateOp enum_op, return true; } -static JSBool +static bool its_resolve(JSContext *cx, HandleObject obj, HandleId id, unsigned flags, MutableHandleObject objp) { @@ -4245,7 +4245,7 @@ its_resolve(JSContext *cx, HandleObject obj, HandleId id, unsigned flags, return true; } -static JSBool +static bool its_convert(JSContext *cx, HandleObject obj, JSType type, MutableHandleValue vp) { if (its_noisy) @@ -4267,7 +4267,7 @@ static JSClass its_class = { its_convert, its_finalize, }; -static JSBool +static bool its_getter(JSContext *cx, HandleObject obj, HandleId id, MutableHandleValue vp) { if (JS_GetClass(obj) != &its_class) { @@ -4279,8 +4279,8 @@ its_getter(JSContext *cx, HandleObject obj, HandleId id, MutableHandleValue vp) return true; } -static JSBool -its_setter(JSContext *cx, HandleObject obj, HandleId id, JSBool strict, MutableHandleValue vp) +static bool +its_setter(JSContext *cx, HandleObject obj, HandleId id, bool strict, MutableHandleValue vp) { if (JS_GetClass(obj) != &its_class) return true; @@ -4352,7 +4352,7 @@ my_ErrorReporter(JSContext *cx, const char *message, JSErrorReport *report) } #if defined(SHELL_HACK) && defined(DEBUG) && defined(XP_UNIX) -static JSBool +static bool Exec(JSContext *cx, unsigned argc, jsval *vp) { JSFunction *fun; @@ -4416,7 +4416,7 @@ Exec(JSContext *cx, unsigned argc, jsval *vp) } #endif -static JSBool +static bool global_enumerate(JSContext *cx, HandleObject obj) { #ifdef LAZY_STANDARD_CLASSES @@ -4426,12 +4426,12 @@ global_enumerate(JSContext *cx, HandleObject obj) #endif } -static JSBool +static bool global_resolve(JSContext *cx, HandleObject obj, HandleId id, unsigned flags, MutableHandleObject objp) { #ifdef LAZY_STANDARD_CLASSES - JSBool resolved; + bool resolved; if (!JS_ResolveStandardClass(cx, obj, id, &resolved)) return false; @@ -4501,8 +4501,8 @@ JSClass global_class = { JS_ConvertStub, NULL }; -static JSBool -env_setProperty(JSContext *cx, HandleObject obj, HandleId id, JSBool strict, MutableHandleValue vp) +static bool +env_setProperty(JSContext *cx, HandleObject obj, HandleId id, bool strict, MutableHandleValue vp) { /* XXX porting may be easy, but these don't seem to supply setenv by default */ #if !defined XP_OS2 && !defined SOLARIS @@ -4545,7 +4545,7 @@ env_setProperty(JSContext *cx, HandleObject obj, HandleId id, JSBool strict, Mut return true; } -static JSBool +static bool env_enumerate(JSContext *cx, HandleObject obj) { static bool reflected; @@ -4573,7 +4573,7 @@ env_enumerate(JSContext *cx, HandleObject obj) return true; } -static JSBool +static bool env_resolve(JSContext *cx, HandleObject obj, HandleId id, unsigned flags, MutableHandleObject objp) { @@ -4820,7 +4820,7 @@ dom_constructor(JSContext* cx, unsigned argc, JS::Value *vp) return true; } -static JSBool +static bool InstanceClassHasProtoAtDepth(HandleObject protoObject, uint32_t protoID, uint32_t depth) { /* There's only a single (fake) DOM object in the shell, so just return true. */ @@ -5264,7 +5264,7 @@ MaybeOverrideOutFileFromEnv(const char* const envVar, /* Set the initial counter to 1 so the principal will never be destroyed. */ JSPrincipals shellTrustedPrincipals = { 1 }; -JSBool +bool CheckObjectAccess(JSContext *cx, HandleObject obj, HandleId id, JSAccessMode mode, MutableHandleValue vp) { diff --git a/js/src/vm/ArgumentsObject.cpp b/js/src/vm/ArgumentsObject.cpp index aa0667261450b..b628ae2106297 100644 --- a/js/src/vm/ArgumentsObject.cpp +++ b/js/src/vm/ArgumentsObject.cpp @@ -280,8 +280,8 @@ ArgumentsObject::createForIon(JSContext *cx, ion::IonJSFrameLayout *frame, Handl } #endif -static JSBool -args_delProperty(JSContext *cx, HandleObject obj, HandleId id, JSBool *succeeded) +static bool +args_delProperty(JSContext *cx, HandleObject obj, HandleId id, bool *succeeded) { ArgumentsObject &argsobj = obj->as(); if (JSID_IS_INT(id)) { @@ -297,7 +297,7 @@ args_delProperty(JSContext *cx, HandleObject obj, HandleId id, JSBool *succeeded return true; } -static JSBool +static bool ArgGetter(JSContext *cx, HandleObject obj, HandleId id, MutableHandleValue vp) { if (!obj->is()) @@ -323,8 +323,8 @@ ArgGetter(JSContext *cx, HandleObject obj, HandleId id, MutableHandleValue vp) return true; } -static JSBool -ArgSetter(JSContext *cx, HandleObject obj, HandleId id, JSBool strict, MutableHandleValue vp) +static bool +ArgSetter(JSContext *cx, HandleObject obj, HandleId id, bool strict, MutableHandleValue vp) { if (!obj->is()) return true; @@ -358,12 +358,12 @@ ArgSetter(JSContext *cx, HandleObject obj, HandleId id, JSBool strict, MutableHa * of setting it in case the user has changed the prototype to an object * that has a setter for this id. */ - JSBool succeeded; + bool succeeded; return baseops::DeleteGeneric(cx, obj, id, &succeeded) && baseops::DefineGeneric(cx, obj, id, vp, NULL, NULL, attrs); } -static JSBool +static bool args_resolve(JSContext *cx, HandleObject obj, HandleId id, unsigned flags, MutableHandleObject objp) { @@ -397,7 +397,7 @@ args_resolve(JSContext *cx, HandleObject obj, HandleId id, unsigned flags, return true; } -static JSBool +static bool args_enumerate(JSContext *cx, HandleObject obj) { Rooted argsobj(cx, &obj->as()); @@ -423,7 +423,7 @@ args_enumerate(JSContext *cx, HandleObject obj) return true; } -static JSBool +static bool StrictArgGetter(JSContext *cx, HandleObject obj, HandleId id, MutableHandleValue vp) { if (!obj->is()) @@ -447,8 +447,8 @@ StrictArgGetter(JSContext *cx, HandleObject obj, HandleId id, MutableHandleValue return true; } -static JSBool -StrictArgSetter(JSContext *cx, HandleObject obj, HandleId id, JSBool strict, MutableHandleValue vp) +static bool +StrictArgSetter(JSContext *cx, HandleObject obj, HandleId id, bool strict, MutableHandleValue vp) { if (!obj->is()) return true; @@ -477,12 +477,12 @@ StrictArgSetter(JSContext *cx, HandleObject obj, HandleId id, JSBool strict, Mut * args_delProperty to clear the corresponding reserved slot so the GC can * collect its value. */ - JSBool succeeded; + bool succeeded; return baseops::DeleteGeneric(cx, argsobj, id, &succeeded) && baseops::DefineGeneric(cx, argsobj, id, vp, NULL, NULL, attrs); } -static JSBool +static bool strictargs_resolve(JSContext *cx, HandleObject obj, HandleId id, unsigned flags, MutableHandleObject objp) { @@ -520,7 +520,7 @@ strictargs_resolve(JSContext *cx, HandleObject obj, HandleId id, unsigned flags, return true; } -static JSBool +static bool strictargs_enumerate(JSContext *cx, HandleObject obj) { Rooted argsobj(cx, &obj->as()); diff --git a/js/src/vm/Debugger.cpp b/js/src/vm/Debugger.cpp index 5aa4aca7f270a..951136b235920 100644 --- a/js/src/vm/Debugger.cpp +++ b/js/src/vm/Debugger.cpp @@ -4127,7 +4127,7 @@ DebuggerFrame_setOnPop(JSContext *cx, unsigned argc, Value *vp) * environment; either way, |frame|'s scope is where newly declared variables * go. In this case, |frame| must have a computed 'this' value, equal to |thisv|. */ -JSBool +bool js::EvaluateInEnv(JSContext *cx, Handle env, HandleValue thisv, AbstractFramePtr frame, StableCharPtr chars, unsigned length, const char *filename, unsigned lineno, MutableHandleValue rval) @@ -4828,7 +4828,7 @@ DebuggerObject_deleteProperty(JSContext *cx, unsigned argc, Value *vp) if (!cx->compartment()->wrap(cx, &nameArg)) return false; - JSBool succeeded; + bool succeeded; ErrorCopier ec(ac, dbg->toJSObject()); if (!JSObject::deleteByValue(cx, obj, nameArg, &succeeded)) return false; @@ -5480,7 +5480,7 @@ static const JSFunctionSpec DebuggerEnv_methods[] = { /*** Glue ****************************************************************************************/ -extern JS_PUBLIC_API(JSBool) +extern JS_PUBLIC_API(bool) JS_DefineDebuggerObject(JSContext *cx, JSObject *obj_) { RootedObject obj(cx, obj_); diff --git a/js/src/vm/Debugger.h b/js/src/vm/Debugger.h index cba0194694dcc..3867ed52c18b5 100644 --- a/js/src/vm/Debugger.h +++ b/js/src/vm/Debugger.h @@ -150,7 +150,7 @@ class Debugger : private mozilla::LinkedListElement { friend class Breakpoint; friend class mozilla::LinkedListElement; - friend JSBool (::JS_DefineDebuggerObject)(JSContext *cx, JSObject *obj); + friend bool (::JS_DefineDebuggerObject)(JSContext *cx, JSObject *obj); public: enum Hook { @@ -322,8 +322,6 @@ class Debugger : private mozilla::LinkedListElement static bool clearAllBreakpoints(JSContext *cx, unsigned argc, Value *vp); static bool findScripts(JSContext *cx, unsigned argc, Value *vp); static bool findAllGlobals(JSContext *cx, unsigned argc, Value *vp); -// njn: ? -// static JSBool wrap(JSContext *cx, unsigned argc, Value *vp); static bool construct(JSContext *cx, unsigned argc, Value *vp); static const JSPropertySpec properties[]; static const JSFunctionSpec methods[]; @@ -699,7 +697,7 @@ Debugger::onNewGlobalObject(JSContext *cx, Handle global) Debugger::slowPathOnNewGlobalObject(cx, global); } -extern JSBool +extern bool EvaluateInEnv(JSContext *cx, Handle env, HandleValue thisv, AbstractFramePtr frame, StableCharPtr chars, unsigned length, const char *filename, unsigned lineno, MutableHandleValue rval); diff --git a/js/src/vm/Interpreter.cpp b/js/src/vm/Interpreter.cpp index e29057484239a..ce5996411e87a 100644 --- a/js/src/vm/Interpreter.cpp +++ b/js/src/vm/Interpreter.cpp @@ -220,7 +220,7 @@ js::OnUnknownMethod(JSContext *cx, HandleObject obj, Value idval_, MutableHandle return true; } -static JSBool +static bool NoSuchMethod(JSContext *cx, unsigned argc, Value *vp) { InvokeArgs args(cx); @@ -239,7 +239,7 @@ NoSuchMethod(JSContext *cx, unsigned argc, Value *vp) if (!argsobj) return false; args[1].setObject(*argsobj); - JSBool ok = Invoke(cx, args); + bool ok = Invoke(cx, args); vp[0] = args.rval(); return ok; } @@ -502,7 +502,7 @@ js::Invoke(JSContext *cx, CallArgs args, MaybeConstruct construct) } } - JSBool ok = RunScript(cx, state); + bool ok = RunScript(cx, state); JS_ASSERT_IF(ok && construct, !args.rval().isPrimitive()); return ok; @@ -670,7 +670,7 @@ js::HasInstance(JSContext *cx, HandleObject obj, HandleValue v, bool *bp) Class *clasp = obj->getClass(); RootedValue local(cx, v); if (clasp->hasInstance) { - JSBool b; + bool b; if (!clasp->hasInstance(cx, obj, &local, &b)) return false; *bp = b; @@ -2260,7 +2260,7 @@ BEGIN_CASE(JSOP_DELPROP) RootedObject &obj = rootObject0; FETCH_OBJECT(cx, -1, obj); - JSBool succeeded; + bool succeeded; if (!JSObject::deleteProperty(cx, obj, name, &succeeded)) goto error; if (!succeeded && script->strict) { @@ -2281,7 +2281,7 @@ BEGIN_CASE(JSOP_DELELEM) RootedValue &propval = rootValue0; propval = regs.sp[-1]; - JSBool succeeded; + bool succeeded; if (!JSObject::deleteByValue(cx, obj, propval, &succeeded)) goto error; if (!succeeded && script->strict) { @@ -3669,7 +3669,7 @@ js::DeleteProperty(JSContext *cx, HandleValue v, HandlePropertyName name, bool * if (!obj) return false; - JSBool b; + bool b; if (!JSObject::deleteProperty(cx, obj, name, &b)) return false; *bp = b; @@ -3692,7 +3692,7 @@ js::DeleteElement(JSContext *cx, HandleValue val, HandleValue index, bool *bp) if (!obj) return false; - JSBool b; + bool b; if (!JSObject::deleteByValue(cx, obj, index, &b)) return false; *bp = b; @@ -3814,7 +3814,7 @@ js::DeleteNameOperation(JSContext *cx, HandlePropertyName name, HandleObject sco return true; } - JSBool succeeded; + bool succeeded; if (!JSObject::deleteProperty(cx, scope, name, &succeeded)) return false; res.setBoolean(succeeded); diff --git a/js/src/vm/ScopeObject.cpp b/js/src/vm/ScopeObject.cpp index ce5bb059043a8..2375eb8722f64 100644 --- a/js/src/vm/ScopeObject.cpp +++ b/js/src/vm/ScopeObject.cpp @@ -400,7 +400,7 @@ WithObject::create(JSContext *cx, HandleObject proto, HandleObject enclosing, ui return &obj->as(); } -static JSBool +static bool with_LookupGeneric(JSContext *cx, HandleObject obj, HandleId id, MutableHandleObject objp, MutableHandleShape propp) { @@ -408,7 +408,7 @@ with_LookupGeneric(JSContext *cx, HandleObject obj, HandleId id, return JSObject::lookupGeneric(cx, actual, id, objp, propp); } -static JSBool +static bool with_LookupProperty(JSContext *cx, HandleObject obj, HandlePropertyName name, MutableHandleObject objp, MutableHandleShape propp) { @@ -416,7 +416,7 @@ with_LookupProperty(JSContext *cx, HandleObject obj, HandlePropertyName name, return with_LookupGeneric(cx, obj, id, objp, propp); } -static JSBool +static bool with_LookupElement(JSContext *cx, HandleObject obj, uint32_t index, MutableHandleObject objp, MutableHandleShape propp) { @@ -426,7 +426,7 @@ with_LookupElement(JSContext *cx, HandleObject obj, uint32_t index, return with_LookupGeneric(cx, obj, id, objp, propp); } -static JSBool +static bool with_LookupSpecial(JSContext *cx, HandleObject obj, HandleSpecialId sid, MutableHandleObject objp, MutableHandleShape propp) { @@ -434,7 +434,7 @@ with_LookupSpecial(JSContext *cx, HandleObject obj, HandleSpecialId sid, return with_LookupGeneric(cx, obj, id, objp, propp); } -static JSBool +static bool with_GetGeneric(JSContext *cx, HandleObject obj, HandleObject receiver, HandleId id, MutableHandleValue vp) { @@ -442,7 +442,7 @@ with_GetGeneric(JSContext *cx, HandleObject obj, HandleObject receiver, HandleId return JSObject::getGeneric(cx, actual, actual, id, vp); } -static JSBool +static bool with_GetProperty(JSContext *cx, HandleObject obj, HandleObject receiver, HandlePropertyName name, MutableHandleValue vp) { @@ -450,7 +450,7 @@ with_GetProperty(JSContext *cx, HandleObject obj, HandleObject receiver, HandleP return with_GetGeneric(cx, obj, receiver, id, vp); } -static JSBool +static bool with_GetElement(JSContext *cx, HandleObject obj, HandleObject receiver, uint32_t index, MutableHandleValue vp) { @@ -460,7 +460,7 @@ with_GetElement(JSContext *cx, HandleObject obj, HandleObject receiver, uint32_t return with_GetGeneric(cx, obj, receiver, id, vp); } -static JSBool +static bool with_GetSpecial(JSContext *cx, HandleObject obj, HandleObject receiver, HandleSpecialId sid, MutableHandleValue vp) { @@ -468,119 +468,119 @@ with_GetSpecial(JSContext *cx, HandleObject obj, HandleObject receiver, HandleSp return with_GetGeneric(cx, obj, receiver, id, vp); } -static JSBool +static bool with_SetGeneric(JSContext *cx, HandleObject obj, HandleId id, - MutableHandleValue vp, JSBool strict) + MutableHandleValue vp, bool strict) { RootedObject actual(cx, &obj->as().object()); return JSObject::setGeneric(cx, actual, actual, id, vp, strict); } -static JSBool +static bool with_SetProperty(JSContext *cx, HandleObject obj, HandlePropertyName name, - MutableHandleValue vp, JSBool strict) + MutableHandleValue vp, bool strict) { RootedObject actual(cx, &obj->as().object()); return JSObject::setProperty(cx, actual, actual, name, vp, strict); } -static JSBool +static bool with_SetElement(JSContext *cx, HandleObject obj, uint32_t index, - MutableHandleValue vp, JSBool strict) + MutableHandleValue vp, bool strict) { RootedObject actual(cx, &obj->as().object()); return JSObject::setElement(cx, actual, actual, index, vp, strict); } -static JSBool +static bool with_SetSpecial(JSContext *cx, HandleObject obj, HandleSpecialId sid, - MutableHandleValue vp, JSBool strict) + MutableHandleValue vp, bool strict) { RootedObject actual(cx, &obj->as().object()); return JSObject::setSpecial(cx, actual, actual, sid, vp, strict); } -static JSBool +static bool with_GetGenericAttributes(JSContext *cx, HandleObject obj, HandleId id, unsigned *attrsp) { RootedObject actual(cx, &obj->as().object()); return JSObject::getGenericAttributes(cx, actual, id, attrsp); } -static JSBool +static bool with_GetPropertyAttributes(JSContext *cx, HandleObject obj, HandlePropertyName name, unsigned *attrsp) { RootedObject actual(cx, &obj->as().object()); return JSObject::getPropertyAttributes(cx, actual, name, attrsp); } -static JSBool +static bool with_GetElementAttributes(JSContext *cx, HandleObject obj, uint32_t index, unsigned *attrsp) { RootedObject actual(cx, &obj->as().object()); return JSObject::getElementAttributes(cx, actual, index, attrsp); } -static JSBool +static bool with_GetSpecialAttributes(JSContext *cx, HandleObject obj, HandleSpecialId sid, unsigned *attrsp) { RootedObject actual(cx, &obj->as().object()); return JSObject::getSpecialAttributes(cx, actual, sid, attrsp); } -static JSBool +static bool with_SetGenericAttributes(JSContext *cx, HandleObject obj, HandleId id, unsigned *attrsp) { RootedObject actual(cx, &obj->as().object()); return JSObject::setGenericAttributes(cx, actual, id, attrsp); } -static JSBool +static bool with_SetPropertyAttributes(JSContext *cx, HandleObject obj, HandlePropertyName name, unsigned *attrsp) { RootedObject actual(cx, &obj->as().object()); return JSObject::setPropertyAttributes(cx, actual, name, attrsp); } -static JSBool +static bool with_SetElementAttributes(JSContext *cx, HandleObject obj, uint32_t index, unsigned *attrsp) { RootedObject actual(cx, &obj->as().object()); return JSObject::setElementAttributes(cx, actual, index, attrsp); } -static JSBool +static bool with_SetSpecialAttributes(JSContext *cx, HandleObject obj, HandleSpecialId sid, unsigned *attrsp) { RootedObject actual(cx, &obj->as().object()); return JSObject::setSpecialAttributes(cx, actual, sid, attrsp); } -static JSBool +static bool with_DeleteProperty(JSContext *cx, HandleObject obj, HandlePropertyName name, - JSBool *succeeded) + bool *succeeded) { RootedObject actual(cx, &obj->as().object()); return JSObject::deleteProperty(cx, actual, name, succeeded); } -static JSBool +static bool with_DeleteElement(JSContext *cx, HandleObject obj, uint32_t index, - JSBool *succeeded) + bool *succeeded) { RootedObject actual(cx, &obj->as().object()); return JSObject::deleteElement(cx, actual, index, succeeded); } -static JSBool +static bool with_DeleteSpecial(JSContext *cx, HandleObject obj, HandleSpecialId sid, - JSBool *succeeded) + bool *succeeded) { RootedObject actual(cx, &obj->as().object()); return JSObject::deleteSpecial(cx, actual, sid, succeeded); } -static JSBool +static bool with_Enumerate(JSContext *cx, HandleObject obj, JSIterateOp enum_op, MutableHandleValue statep, MutableHandleId idp) { @@ -1504,7 +1504,7 @@ class DebugScopeProxy : public BaseProxyHandler return true; } - JSBool found; + bool found; RootedObject scope(cx, &scopeObj); if (!JS_HasPropertyById(cx, scope, id, &found)) return false; diff --git a/js/src/vm/TypedArrayObject.cpp b/js/src/vm/TypedArrayObject.cpp index 06d3f57ed2254..ce1c56c3f8675 100644 --- a/js/src/vm/TypedArrayObject.cpp +++ b/js/src/vm/TypedArrayObject.cpp @@ -798,7 +798,7 @@ ArrayBufferObject::restoreArrayBufferLists(ArrayBufferVector &vector) } } -JSBool +bool ArrayBufferObject::obj_lookupGeneric(JSContext *cx, HandleObject obj, HandleId id, MutableHandleObject objp, MutableHandleShape propp) { @@ -806,7 +806,7 @@ ArrayBufferObject::obj_lookupGeneric(JSContext *cx, HandleObject obj, HandleId i if (!delegate) return false; - JSBool delegateResult = JSObject::lookupGeneric(cx, delegate, id, objp, propp); + bool delegateResult = JSObject::lookupGeneric(cx, delegate, id, objp, propp); /* If false, there was an error, so propagate it. * Otherwise, if propp is non-null, the property @@ -832,7 +832,7 @@ ArrayBufferObject::obj_lookupGeneric(JSContext *cx, HandleObject obj, HandleId i return JSObject::lookupGeneric(cx, proto, id, objp, propp); } -JSBool +bool ArrayBufferObject::obj_lookupProperty(JSContext *cx, HandleObject obj, HandlePropertyName name, MutableHandleObject objp, MutableHandleShape propp) { @@ -840,7 +840,7 @@ ArrayBufferObject::obj_lookupProperty(JSContext *cx, HandleObject obj, HandlePro return obj_lookupGeneric(cx, obj, id, objp, propp); } -JSBool +bool ArrayBufferObject::obj_lookupElement(JSContext *cx, HandleObject obj, uint32_t index, MutableHandleObject objp, MutableHandleShape propp) { @@ -872,7 +872,7 @@ ArrayBufferObject::obj_lookupElement(JSContext *cx, HandleObject obj, uint32_t i return true; } -JSBool +bool ArrayBufferObject::obj_lookupSpecial(JSContext *cx, HandleObject obj, HandleSpecialId sid, MutableHandleObject objp, MutableHandleShape propp) { @@ -880,7 +880,7 @@ ArrayBufferObject::obj_lookupSpecial(JSContext *cx, HandleObject obj, HandleSpec return obj_lookupGeneric(cx, obj, id, objp, propp); } -JSBool +bool ArrayBufferObject::obj_defineGeneric(JSContext *cx, HandleObject obj, HandleId id, HandleValue v, PropertyOp getter, StrictPropertyOp setter, unsigned attrs) { @@ -892,7 +892,7 @@ ArrayBufferObject::obj_defineGeneric(JSContext *cx, HandleObject obj, HandleId i return baseops::DefineGeneric(cx, delegate, id, v, getter, setter, attrs); } -JSBool +bool ArrayBufferObject::obj_defineProperty(JSContext *cx, HandleObject obj, HandlePropertyName name, HandleValue v, PropertyOp getter, StrictPropertyOp setter, unsigned attrs) @@ -901,7 +901,7 @@ ArrayBufferObject::obj_defineProperty(JSContext *cx, HandleObject obj, return obj_defineGeneric(cx, obj, id, v, getter, setter, attrs); } -JSBool +bool ArrayBufferObject::obj_defineElement(JSContext *cx, HandleObject obj, uint32_t index, HandleValue v, PropertyOp getter, StrictPropertyOp setter, unsigned attrs) { @@ -913,7 +913,7 @@ ArrayBufferObject::obj_defineElement(JSContext *cx, HandleObject obj, uint32_t i return baseops::DefineElement(cx, delegate, index, v, getter, setter, attrs); } -JSBool +bool ArrayBufferObject::obj_defineSpecial(JSContext *cx, HandleObject obj, HandleSpecialId sid, HandleValue v, PropertyOp getter, StrictPropertyOp setter, unsigned attrs) { @@ -921,7 +921,7 @@ ArrayBufferObject::obj_defineSpecial(JSContext *cx, HandleObject obj, HandleSpec return obj_defineGeneric(cx, obj, id, v, getter, setter, attrs); } -JSBool +bool ArrayBufferObject::obj_getGeneric(JSContext *cx, HandleObject obj, HandleObject receiver, HandleId id, MutableHandleValue vp) { @@ -931,7 +931,7 @@ ArrayBufferObject::obj_getGeneric(JSContext *cx, HandleObject obj, HandleObject return baseops::GetProperty(cx, delegate, receiver, id, vp); } -JSBool +bool ArrayBufferObject::obj_getProperty(JSContext *cx, HandleObject obj, HandleObject receiver, HandlePropertyName name, MutableHandleValue vp) { @@ -942,7 +942,7 @@ ArrayBufferObject::obj_getProperty(JSContext *cx, HandleObject obj, HandleObject return baseops::GetProperty(cx, delegate, receiver, id, vp); } -JSBool +bool ArrayBufferObject::obj_getElement(JSContext *cx, HandleObject obj, HandleObject receiver, uint32_t index, MutableHandleValue vp) { @@ -952,7 +952,7 @@ ArrayBufferObject::obj_getElement(JSContext *cx, HandleObject obj, return baseops::GetElement(cx, delegate, receiver, index, vp); } -JSBool +bool ArrayBufferObject::obj_getElementIfPresent(JSContext *cx, HandleObject obj, HandleObject receiver, uint32_t index, MutableHandleValue vp, bool *present) { @@ -962,7 +962,7 @@ ArrayBufferObject::obj_getElementIfPresent(JSContext *cx, HandleObject obj, Hand return JSObject::getElementIfPresent(cx, delegate, receiver, index, vp, present); } -JSBool +bool ArrayBufferObject::obj_getSpecial(JSContext *cx, HandleObject obj, HandleObject receiver, HandleSpecialId sid, MutableHandleValue vp) @@ -971,9 +971,9 @@ ArrayBufferObject::obj_getSpecial(JSContext *cx, HandleObject obj, return obj_getGeneric(cx, obj, receiver, id, vp); } -JSBool +bool ArrayBufferObject::obj_setGeneric(JSContext *cx, HandleObject obj, HandleId id, - MutableHandleValue vp, JSBool strict) + MutableHandleValue vp, bool strict) { RootedObject delegate(cx, ArrayBufferDelegate(cx, obj)); if (!delegate) @@ -982,17 +982,17 @@ ArrayBufferObject::obj_setGeneric(JSContext *cx, HandleObject obj, HandleId id, return baseops::SetPropertyHelper(cx, delegate, obj, id, 0, vp, strict); } -JSBool +bool ArrayBufferObject::obj_setProperty(JSContext *cx, HandleObject obj, - HandlePropertyName name, MutableHandleValue vp, JSBool strict) + HandlePropertyName name, MutableHandleValue vp, bool strict) { Rooted id(cx, NameToId(name)); return obj_setGeneric(cx, obj, id, vp, strict); } -JSBool +bool ArrayBufferObject::obj_setElement(JSContext *cx, HandleObject obj, - uint32_t index, MutableHandleValue vp, JSBool strict) + uint32_t index, MutableHandleValue vp, bool strict) { RootedObject delegate(cx, ArrayBufferDelegate(cx, obj)); if (!delegate) @@ -1001,15 +1001,15 @@ ArrayBufferObject::obj_setElement(JSContext *cx, HandleObject obj, return baseops::SetElementHelper(cx, delegate, obj, index, 0, vp, strict); } -JSBool +bool ArrayBufferObject::obj_setSpecial(JSContext *cx, HandleObject obj, - HandleSpecialId sid, MutableHandleValue vp, JSBool strict) + HandleSpecialId sid, MutableHandleValue vp, bool strict) { Rooted id(cx, SPECIALID_TO_JSID(sid)); return obj_setGeneric(cx, obj, id, vp, strict); } -JSBool +bool ArrayBufferObject::obj_getGenericAttributes(JSContext *cx, HandleObject obj, HandleId id, unsigned *attrsp) { @@ -1019,7 +1019,7 @@ ArrayBufferObject::obj_getGenericAttributes(JSContext *cx, HandleObject obj, return baseops::GetAttributes(cx, delegate, id, attrsp); } -JSBool +bool ArrayBufferObject::obj_getPropertyAttributes(JSContext *cx, HandleObject obj, HandlePropertyName name, unsigned *attrsp) { @@ -1027,7 +1027,7 @@ ArrayBufferObject::obj_getPropertyAttributes(JSContext *cx, HandleObject obj, return obj_getGenericAttributes(cx, obj, id, attrsp); } -JSBool +bool ArrayBufferObject::obj_getElementAttributes(JSContext *cx, HandleObject obj, uint32_t index, unsigned *attrsp) { @@ -1037,7 +1037,7 @@ ArrayBufferObject::obj_getElementAttributes(JSContext *cx, HandleObject obj, return baseops::GetElementAttributes(cx, delegate, index, attrsp); } -JSBool +bool ArrayBufferObject::obj_getSpecialAttributes(JSContext *cx, HandleObject obj, HandleSpecialId sid, unsigned *attrsp) { @@ -1045,7 +1045,7 @@ ArrayBufferObject::obj_getSpecialAttributes(JSContext *cx, HandleObject obj, return obj_getGenericAttributes(cx, obj, id, attrsp); } -JSBool +bool ArrayBufferObject::obj_setGenericAttributes(JSContext *cx, HandleObject obj, HandleId id, unsigned *attrsp) { @@ -1055,7 +1055,7 @@ ArrayBufferObject::obj_setGenericAttributes(JSContext *cx, HandleObject obj, return baseops::SetAttributes(cx, delegate, id, attrsp); } -JSBool +bool ArrayBufferObject::obj_setPropertyAttributes(JSContext *cx, HandleObject obj, HandlePropertyName name, unsigned *attrsp) { @@ -1063,7 +1063,7 @@ ArrayBufferObject::obj_setPropertyAttributes(JSContext *cx, HandleObject obj, return obj_setGenericAttributes(cx, obj, id, attrsp); } -JSBool +bool ArrayBufferObject::obj_setElementAttributes(JSContext *cx, HandleObject obj, uint32_t index, unsigned *attrsp) { @@ -1073,7 +1073,7 @@ ArrayBufferObject::obj_setElementAttributes(JSContext *cx, HandleObject obj, return baseops::SetElementAttributes(cx, delegate, index, attrsp); } -JSBool +bool ArrayBufferObject::obj_setSpecialAttributes(JSContext *cx, HandleObject obj, HandleSpecialId sid, unsigned *attrsp) { @@ -1081,9 +1081,9 @@ ArrayBufferObject::obj_setSpecialAttributes(JSContext *cx, HandleObject obj, return obj_setGenericAttributes(cx, obj, id, attrsp); } -JSBool +bool ArrayBufferObject::obj_deleteProperty(JSContext *cx, HandleObject obj, HandlePropertyName name, - JSBool *succeeded) + bool *succeeded) { RootedObject delegate(cx, ArrayBufferDelegate(cx, obj)); if (!delegate) @@ -1091,9 +1091,9 @@ ArrayBufferObject::obj_deleteProperty(JSContext *cx, HandleObject obj, HandlePro return baseops::DeleteProperty(cx, delegate, name, succeeded); } -JSBool +bool ArrayBufferObject::obj_deleteElement(JSContext *cx, HandleObject obj, uint32_t index, - JSBool *succeeded) + bool *succeeded) { RootedObject delegate(cx, ArrayBufferDelegate(cx, obj)); if (!delegate) @@ -1101,9 +1101,9 @@ ArrayBufferObject::obj_deleteElement(JSContext *cx, HandleObject obj, uint32_t i return baseops::DeleteElement(cx, delegate, index, succeeded); } -JSBool +bool ArrayBufferObject::obj_deleteSpecial(JSContext *cx, HandleObject obj, HandleSpecialId sid, - JSBool *succeeded) + bool *succeeded) { RootedObject delegate(cx, ArrayBufferDelegate(cx, obj)); if (!delegate) @@ -1111,7 +1111,7 @@ ArrayBufferObject::obj_deleteSpecial(JSContext *cx, HandleObject obj, HandleSpec return baseops::DeleteSpecial(cx, delegate, sid, succeeded); } -JSBool +bool ArrayBufferObject::obj_enumerate(JSContext *cx, HandleObject obj, JSIterateOp enum_op, MutableHandleValue statep, MutableHandleId idp) { @@ -1167,7 +1167,7 @@ TypedArrayObject::neuter() setPrivate(NULL); } -JSBool +bool TypedArrayObject::obj_lookupGeneric(JSContext *cx, HandleObject tarray, HandleId id, MutableHandleObject objp, MutableHandleShape propp) { @@ -1187,7 +1187,7 @@ TypedArrayObject::obj_lookupGeneric(JSContext *cx, HandleObject tarray, HandleId return JSObject::lookupGeneric(cx, proto, id, objp, propp); } -JSBool +bool TypedArrayObject::obj_lookupProperty(JSContext *cx, HandleObject obj, HandlePropertyName name, MutableHandleObject objp, MutableHandleShape propp) { @@ -1195,7 +1195,7 @@ TypedArrayObject::obj_lookupProperty(JSContext *cx, HandleObject obj, HandleProp return obj_lookupGeneric(cx, obj, id, objp, propp); } -JSBool +bool TypedArrayObject::obj_lookupElement(JSContext *cx, HandleObject tarray, uint32_t index, MutableHandleObject objp, MutableHandleShape propp) { @@ -1214,7 +1214,7 @@ TypedArrayObject::obj_lookupElement(JSContext *cx, HandleObject tarray, uint32_t return true; } -JSBool +bool TypedArrayObject::obj_lookupSpecial(JSContext *cx, HandleObject obj, HandleSpecialId sid, MutableHandleObject objp, MutableHandleShape propp) { @@ -1222,7 +1222,7 @@ TypedArrayObject::obj_lookupSpecial(JSContext *cx, HandleObject obj, HandleSpeci return obj_lookupGeneric(cx, obj, id, objp, propp); } -JSBool +bool TypedArrayObject::obj_getGenericAttributes(JSContext *cx, HandleObject obj, HandleId id, unsigned *attrsp) { @@ -1230,7 +1230,7 @@ TypedArrayObject::obj_getGenericAttributes(JSContext *cx, HandleObject obj, Hand return true; } -JSBool +bool TypedArrayObject::obj_getPropertyAttributes(JSContext *cx, HandleObject obj, HandlePropertyName name, unsigned *attrsp) { @@ -1238,7 +1238,7 @@ TypedArrayObject::obj_getPropertyAttributes(JSContext *cx, HandleObject obj, return true; } -JSBool +bool TypedArrayObject::obj_getElementAttributes(JSContext *cx, HandleObject obj, uint32_t index, unsigned *attrsp) { @@ -1246,7 +1246,7 @@ TypedArrayObject::obj_getElementAttributes(JSContext *cx, HandleObject obj, uint return true; } -JSBool +bool TypedArrayObject::obj_getSpecialAttributes(JSContext *cx, HandleObject obj, HandleSpecialId sid, unsigned *attrsp) { @@ -1254,7 +1254,7 @@ TypedArrayObject::obj_getSpecialAttributes(JSContext *cx, HandleObject obj, Hand return obj_getGenericAttributes(cx, obj, id, attrsp); } -JSBool +bool TypedArrayObject::obj_setGenericAttributes(JSContext *cx, HandleObject obj, HandleId id, unsigned *attrsp) { @@ -1262,7 +1262,7 @@ TypedArrayObject::obj_setGenericAttributes(JSContext *cx, HandleObject obj, Hand return false; } -JSBool +bool TypedArrayObject::obj_setPropertyAttributes(JSContext *cx, HandleObject obj, HandlePropertyName name, unsigned *attrsp) { @@ -1270,7 +1270,7 @@ TypedArrayObject::obj_setPropertyAttributes(JSContext *cx, HandleObject obj, return false; } -JSBool +bool TypedArrayObject::obj_setElementAttributes(JSContext *cx, HandleObject obj, uint32_t index, unsigned *attrsp) { @@ -1278,7 +1278,7 @@ TypedArrayObject::obj_setElementAttributes(JSContext *cx, HandleObject obj, uint return false; } -JSBool +bool TypedArrayObject::obj_setSpecialAttributes(JSContext *cx, HandleObject obj, HandleSpecialId sid, unsigned *attrsp) { @@ -1443,7 +1443,7 @@ class TypedArrayObjectTemplate : public TypedArrayObject return v.isObject() && v.toObject().hasClass(fastClass()); } - static JSBool + static bool obj_getProperty(JSContext *cx, HandleObject obj, HandleObject receiver, HandlePropertyName name, MutableHandleValue vp) { @@ -1456,7 +1456,7 @@ class TypedArrayObjectTemplate : public TypedArrayObject return JSObject::getProperty(cx, proto, receiver, name, vp); } - static JSBool + static bool obj_getElement(JSContext *cx, HandleObject tarray, HandleObject receiver, uint32_t index, MutableHandleValue vp) { @@ -1469,7 +1469,7 @@ class TypedArrayObjectTemplate : public TypedArrayObject return true; } - static JSBool + static bool obj_getSpecial(JSContext *cx, HandleObject obj, HandleObject receiver, HandleSpecialId sid, MutableHandleValue vp) { @@ -1482,7 +1482,7 @@ class TypedArrayObjectTemplate : public TypedArrayObject return JSObject::getSpecial(cx, proto, receiver, sid, vp); } - static JSBool + static bool obj_getGeneric(JSContext *cx, HandleObject obj, HandleObject receiver, HandleId id, MutableHandleValue vp) { @@ -1507,7 +1507,7 @@ class TypedArrayObjectTemplate : public TypedArrayObject return obj_getProperty(cx, obj, receiver, name, vp); } - static JSBool + static bool obj_getElementIfPresent(JSContext *cx, HandleObject tarray, HandleObject receiver, uint32_t index, MutableHandleValue vp, bool *present) { @@ -1530,7 +1530,7 @@ class TypedArrayObjectTemplate : public TypedArrayObject static bool setElementTail(JSContext *cx, HandleObject tarray, uint32_t index, - MutableHandleValue vp, JSBool strict) + MutableHandleValue vp, bool strict) { JS_ASSERT(tarray); JS_ASSERT(index < tarray->as().length()); @@ -1568,9 +1568,9 @@ class TypedArrayObjectTemplate : public TypedArrayObject return true; } - static JSBool + static bool obj_setGeneric(JSContext *cx, HandleObject tarray, HandleId id, - MutableHandleValue vp, JSBool strict) + MutableHandleValue vp, bool strict) { uint32_t index; // We can't just chain to js_SetPropertyHelper, because we're not a normal object. @@ -1587,17 +1587,17 @@ class TypedArrayObjectTemplate : public TypedArrayObject return setElementTail(cx, tarray, index, vp, strict); } - static JSBool + static bool obj_setProperty(JSContext *cx, HandleObject obj, HandlePropertyName name, - MutableHandleValue vp, JSBool strict) + MutableHandleValue vp, bool strict) { Rooted id(cx, NameToId(name)); return obj_setGeneric(cx, obj, id, vp, strict); } - static JSBool + static bool obj_setElement(JSContext *cx, HandleObject tarray, uint32_t index, - MutableHandleValue vp, JSBool strict) + MutableHandleValue vp, bool strict) { if (index >= tarray->as().length()) { // Silent ignore is better than an exception here, because @@ -1612,15 +1612,15 @@ class TypedArrayObjectTemplate : public TypedArrayObject return setElementTail(cx, tarray, index, vp, strict); } - static JSBool + static bool obj_setSpecial(JSContext *cx, HandleObject obj, HandleSpecialId sid, - MutableHandleValue vp, JSBool strict) + MutableHandleValue vp, bool strict) { Rooted id(cx, SPECIALID_TO_JSID(sid)); return obj_setGeneric(cx, obj, id, vp, strict); } - static JSBool + static bool obj_defineGeneric(JSContext *cx, HandleObject obj, HandleId id, HandleValue v, PropertyOp getter, StrictPropertyOp setter, unsigned attrs) { @@ -1628,7 +1628,7 @@ class TypedArrayObjectTemplate : public TypedArrayObject return obj_setGeneric(cx, obj, id, &tmp, false); } - static JSBool + static bool obj_defineProperty(JSContext *cx, HandleObject obj, HandlePropertyName name, HandleValue v, PropertyOp getter, StrictPropertyOp setter, unsigned attrs) { @@ -1636,7 +1636,7 @@ class TypedArrayObjectTemplate : public TypedArrayObject return obj_defineGeneric(cx, obj, id, v, getter, setter, attrs); } - static JSBool + static bool obj_defineElement(JSContext *cx, HandleObject obj, uint32_t index, HandleValue v, PropertyOp getter, StrictPropertyOp setter, unsigned attrs) { @@ -1644,7 +1644,7 @@ class TypedArrayObjectTemplate : public TypedArrayObject return obj_setElement(cx, obj, index, &tmp, false); } - static JSBool + static bool obj_defineSpecial(JSContext *cx, HandleObject obj, HandleSpecialId sid, HandleValue v, PropertyOp getter, StrictPropertyOp setter, unsigned attrs) { @@ -1652,15 +1652,15 @@ class TypedArrayObjectTemplate : public TypedArrayObject return obj_defineGeneric(cx, obj, id, v, getter, setter, attrs); } - static JSBool - obj_deleteProperty(JSContext *cx, HandleObject obj, HandlePropertyName name, JSBool *succeeded) + static bool + obj_deleteProperty(JSContext *cx, HandleObject obj, HandlePropertyName name, bool *succeeded) { *succeeded = true; return true; } - static JSBool - obj_deleteElement(JSContext *cx, HandleObject tarray, uint32_t index, JSBool *succeeded) + static bool + obj_deleteElement(JSContext *cx, HandleObject tarray, uint32_t index, bool *succeeded) { if (index < tarray->as().length()) { *succeeded = false; @@ -1671,14 +1671,14 @@ class TypedArrayObjectTemplate : public TypedArrayObject return true; } - static JSBool - obj_deleteSpecial(JSContext *cx, HandleObject tarray, HandleSpecialId sid, JSBool *succeeded) + static bool + obj_deleteSpecial(JSContext *cx, HandleObject tarray, HandleSpecialId sid, bool *succeeded) { *succeeded = true; return true; } - static JSBool + static bool obj_enumerate(JSContext *cx, HandleObject tarray, JSIterateOp enum_op, MutableHandleValue statep, MutableHandleId idp) { @@ -2792,7 +2792,7 @@ DataViewObject::create(JSContext *cx, uint32_t byteOffset, uint32_t byteLength, return &dvobj; } -JSBool +bool DataViewObject::construct(JSContext *cx, JSObject *bufobj, const CallArgs &args, HandleObject proto) { if (!bufobj->is()) { @@ -3540,7 +3540,7 @@ const JSFunctionSpec _typedArray##Object::jsfuncs[] = { return TypedArrayObjectTemplate::fromBuffer(cx, arrayBuffer, byteOffset, \ length, proto); \ } \ - JS_FRIEND_API(JSBool) JS_Is ## Name ## Array(JSObject *obj) \ + JS_FRIEND_API(bool) JS_Is ## Name ## Array(JSObject *obj) \ { \ if (!(obj = CheckedUnwrap(obj))) \ return false; \ @@ -4015,21 +4015,21 @@ js::IsTypedArrayBuffer(const Value &v) /* JS Friend API */ -JS_FRIEND_API(JSBool) +JS_FRIEND_API(bool) JS_IsArrayBufferObject(JSObject *obj) { obj = CheckedUnwrap(obj); return obj ? obj->is() : false; } -JS_FRIEND_API(JSBool) +JS_FRIEND_API(bool) JS_IsTypedArrayObject(JSObject *obj) { obj = CheckedUnwrap(obj); return obj ? obj->is() : false; } -JS_FRIEND_API(JSBool) +JS_FRIEND_API(bool) JS_IsArrayBufferViewObject(JSObject *obj) { obj = CheckedUnwrap(obj); @@ -4074,7 +4074,7 @@ JS_NewArrayBufferWithContents(JSContext *cx, void *contents) return obj; } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_AllocateArrayBufferContents(JSContext *cx, uint32_t nbytes, void **contents, uint8_t **data) { js::ObjectElements *header = AllocateArrayBufferContents(cx, nbytes, NULL); @@ -4088,7 +4088,7 @@ JS_AllocateArrayBufferContents(JSContext *cx, uint32_t nbytes, void **contents, return true; } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_ReallocateArrayBufferContents(JSContext *cx, uint32_t nbytes, void **contents, uint8_t **data) { js::ObjectElements *header = AllocateArrayBufferContents(cx, nbytes, NULL, *contents); @@ -4102,7 +4102,7 @@ JS_ReallocateArrayBufferContents(JSContext *cx, uint32_t nbytes, void **contents return true; } -JS_PUBLIC_API(JSBool) +JS_PUBLIC_API(bool) JS_StealArrayBufferContents(JSContext *cx, JSObject *obj, void **contents, uint8_t **data) { @@ -4260,7 +4260,7 @@ JS_GetFloat64ArrayData(JSObject *obj) return static_cast(tarr->viewData()); } -JS_FRIEND_API(JSBool) +JS_FRIEND_API(bool) JS_IsDataViewObject(JSObject *obj) { obj = CheckedUnwrap(obj); diff --git a/js/src/vm/TypedArrayObject.h b/js/src/vm/TypedArrayObject.h index 93da2c293df15..dd1892102fec6 100644 --- a/js/src/vm/TypedArrayObject.h +++ b/js/src/vm/TypedArrayObject.h @@ -79,76 +79,76 @@ class ArrayBufferObject : public JSObject static void obj_trace(JSTracer *trc, JSObject *obj); - static JSBool obj_lookupGeneric(JSContext *cx, HandleObject obj, HandleId id, - MutableHandleObject objp, MutableHandleShape propp); - static JSBool obj_lookupProperty(JSContext *cx, HandleObject obj, HandlePropertyName name, - MutableHandleObject objp, MutableHandleShape propp); - static JSBool obj_lookupElement(JSContext *cx, HandleObject obj, uint32_t index, - MutableHandleObject objp, MutableHandleShape propp); - static JSBool obj_lookupSpecial(JSContext *cx, HandleObject obj, HandleSpecialId sid, - MutableHandleObject objp, MutableHandleShape propp); - - static JSBool obj_defineGeneric(JSContext *cx, HandleObject obj, HandleId id, HandleValue v, - PropertyOp getter, StrictPropertyOp setter, unsigned attrs); - static JSBool obj_defineProperty(JSContext *cx, HandleObject obj, - HandlePropertyName name, HandleValue v, - PropertyOp getter, StrictPropertyOp setter, unsigned attrs); - static JSBool obj_defineElement(JSContext *cx, HandleObject obj, uint32_t index, HandleValue v, - PropertyOp getter, StrictPropertyOp setter, unsigned attrs); - static JSBool obj_defineSpecial(JSContext *cx, HandleObject obj, - HandleSpecialId sid, HandleValue v, - PropertyOp getter, StrictPropertyOp setter, unsigned attrs); - - static JSBool obj_getGeneric(JSContext *cx, HandleObject obj, HandleObject receiver, - HandleId id, MutableHandleValue vp); - - static JSBool obj_getProperty(JSContext *cx, HandleObject obj, HandleObject receiver, - HandlePropertyName name, MutableHandleValue vp); - - static JSBool obj_getElement(JSContext *cx, HandleObject obj, HandleObject receiver, - uint32_t index, MutableHandleValue vp); - static JSBool obj_getElementIfPresent(JSContext *cx, HandleObject obj, HandleObject receiver, - uint32_t index, MutableHandleValue vp, bool *present); - - static JSBool obj_getSpecial(JSContext *cx, HandleObject obj, HandleObject receiver, - HandleSpecialId sid, MutableHandleValue vp); - - static JSBool obj_setGeneric(JSContext *cx, HandleObject obj, HandleId id, - MutableHandleValue vp, JSBool strict); - static JSBool obj_setProperty(JSContext *cx, HandleObject obj, HandlePropertyName name, - MutableHandleValue vp, JSBool strict); - static JSBool obj_setElement(JSContext *cx, HandleObject obj, uint32_t index, - MutableHandleValue vp, JSBool strict); - static JSBool obj_setSpecial(JSContext *cx, HandleObject obj, - HandleSpecialId sid, MutableHandleValue vp, JSBool strict); - - static JSBool obj_getGenericAttributes(JSContext *cx, HandleObject obj, - HandleId id, unsigned *attrsp); - static JSBool obj_getPropertyAttributes(JSContext *cx, HandleObject obj, - HandlePropertyName name, unsigned *attrsp); - static JSBool obj_getElementAttributes(JSContext *cx, HandleObject obj, - uint32_t index, unsigned *attrsp); - static JSBool obj_getSpecialAttributes(JSContext *cx, HandleObject obj, - HandleSpecialId sid, unsigned *attrsp); - - static JSBool obj_setGenericAttributes(JSContext *cx, HandleObject obj, - HandleId id, unsigned *attrsp); - static JSBool obj_setPropertyAttributes(JSContext *cx, HandleObject obj, - HandlePropertyName name, unsigned *attrsp); - static JSBool obj_setElementAttributes(JSContext *cx, HandleObject obj, - uint32_t index, unsigned *attrsp); - static JSBool obj_setSpecialAttributes(JSContext *cx, HandleObject obj, - HandleSpecialId sid, unsigned *attrsp); - - static JSBool obj_deleteProperty(JSContext *cx, HandleObject obj, HandlePropertyName name, - JSBool *succeeded); - static JSBool obj_deleteElement(JSContext *cx, HandleObject obj, uint32_t index, - JSBool *succeeded); - static JSBool obj_deleteSpecial(JSContext *cx, HandleObject obj, HandleSpecialId sid, - JSBool *succeeded); - - static JSBool obj_enumerate(JSContext *cx, HandleObject obj, JSIterateOp enum_op, - MutableHandleValue statep, MutableHandleId idp); + static bool obj_lookupGeneric(JSContext *cx, HandleObject obj, HandleId id, + MutableHandleObject objp, MutableHandleShape propp); + static bool obj_lookupProperty(JSContext *cx, HandleObject obj, HandlePropertyName name, + MutableHandleObject objp, MutableHandleShape propp); + static bool obj_lookupElement(JSContext *cx, HandleObject obj, uint32_t index, + MutableHandleObject objp, MutableHandleShape propp); + static bool obj_lookupSpecial(JSContext *cx, HandleObject obj, HandleSpecialId sid, + MutableHandleObject objp, MutableHandleShape propp); + + static bool obj_defineGeneric(JSContext *cx, HandleObject obj, HandleId id, HandleValue v, + PropertyOp getter, StrictPropertyOp setter, unsigned attrs); + static bool obj_defineProperty(JSContext *cx, HandleObject obj, + HandlePropertyName name, HandleValue v, + PropertyOp getter, StrictPropertyOp setter, unsigned attrs); + static bool obj_defineElement(JSContext *cx, HandleObject obj, uint32_t index, HandleValue v, + PropertyOp getter, StrictPropertyOp setter, unsigned attrs); + static bool obj_defineSpecial(JSContext *cx, HandleObject obj, + HandleSpecialId sid, HandleValue v, + PropertyOp getter, StrictPropertyOp setter, unsigned attrs); + + static bool obj_getGeneric(JSContext *cx, HandleObject obj, HandleObject receiver, + HandleId id, MutableHandleValue vp); + + static bool obj_getProperty(JSContext *cx, HandleObject obj, HandleObject receiver, + HandlePropertyName name, MutableHandleValue vp); + + static bool obj_getElement(JSContext *cx, HandleObject obj, HandleObject receiver, + uint32_t index, MutableHandleValue vp); + static bool obj_getElementIfPresent(JSContext *cx, HandleObject obj, HandleObject receiver, + uint32_t index, MutableHandleValue vp, bool *present); + + static bool obj_getSpecial(JSContext *cx, HandleObject obj, HandleObject receiver, + HandleSpecialId sid, MutableHandleValue vp); + + static bool obj_setGeneric(JSContext *cx, HandleObject obj, HandleId id, + MutableHandleValue vp, bool strict); + static bool obj_setProperty(JSContext *cx, HandleObject obj, HandlePropertyName name, + MutableHandleValue vp, bool strict); + static bool obj_setElement(JSContext *cx, HandleObject obj, uint32_t index, + MutableHandleValue vp, bool strict); + static bool obj_setSpecial(JSContext *cx, HandleObject obj, + HandleSpecialId sid, MutableHandleValue vp, bool strict); + + static bool obj_getGenericAttributes(JSContext *cx, HandleObject obj, + HandleId id, unsigned *attrsp); + static bool obj_getPropertyAttributes(JSContext *cx, HandleObject obj, + HandlePropertyName name, unsigned *attrsp); + static bool obj_getElementAttributes(JSContext *cx, HandleObject obj, + uint32_t index, unsigned *attrsp); + static bool obj_getSpecialAttributes(JSContext *cx, HandleObject obj, + HandleSpecialId sid, unsigned *attrsp); + + static bool obj_setGenericAttributes(JSContext *cx, HandleObject obj, + HandleId id, unsigned *attrsp); + static bool obj_setPropertyAttributes(JSContext *cx, HandleObject obj, + HandlePropertyName name, unsigned *attrsp); + static bool obj_setElementAttributes(JSContext *cx, HandleObject obj, + uint32_t index, unsigned *attrsp); + static bool obj_setSpecialAttributes(JSContext *cx, HandleObject obj, + HandleSpecialId sid, unsigned *attrsp); + + static bool obj_deleteProperty(JSContext *cx, HandleObject obj, HandlePropertyName name, + bool *succeeded); + static bool obj_deleteElement(JSContext *cx, HandleObject obj, uint32_t index, + bool *succeeded); + static bool obj_deleteSpecial(JSContext *cx, HandleObject obj, HandleSpecialId sid, + bool *succeeded); + + static bool obj_enumerate(JSContext *cx, HandleObject obj, JSIterateOp enum_op, + MutableHandleValue statep, MutableHandleId idp); static void sweep(JSCompartment *rt); @@ -303,32 +303,32 @@ class TypedArrayObject : public ArrayBufferViewObject static Class classes[TYPE_MAX]; static Class protoClasses[TYPE_MAX]; - static JSBool obj_lookupGeneric(JSContext *cx, HandleObject obj, HandleId id, - MutableHandleObject objp, MutableHandleShape propp); - static JSBool obj_lookupProperty(JSContext *cx, HandleObject obj, HandlePropertyName name, - MutableHandleObject objp, MutableHandleShape propp); - static JSBool obj_lookupElement(JSContext *cx, HandleObject obj, uint32_t index, - MutableHandleObject objp, MutableHandleShape propp); - static JSBool obj_lookupSpecial(JSContext *cx, HandleObject obj, HandleSpecialId sid, - MutableHandleObject objp, MutableHandleShape propp); - - static JSBool obj_getGenericAttributes(JSContext *cx, HandleObject obj, - HandleId id, unsigned *attrsp); - static JSBool obj_getPropertyAttributes(JSContext *cx, HandleObject obj, - HandlePropertyName name, unsigned *attrsp); - static JSBool obj_getElementAttributes(JSContext *cx, HandleObject obj, - uint32_t index, unsigned *attrsp); - static JSBool obj_getSpecialAttributes(JSContext *cx, HandleObject obj, - HandleSpecialId sid, unsigned *attrsp); - - static JSBool obj_setGenericAttributes(JSContext *cx, HandleObject obj, - HandleId id, unsigned *attrsp); - static JSBool obj_setPropertyAttributes(JSContext *cx, HandleObject obj, - HandlePropertyName name, unsigned *attrsp); - static JSBool obj_setElementAttributes(JSContext *cx, HandleObject obj, - uint32_t index, unsigned *attrsp); - static JSBool obj_setSpecialAttributes(JSContext *cx, HandleObject obj, - HandleSpecialId sid, unsigned *attrsp); + static bool obj_lookupGeneric(JSContext *cx, HandleObject obj, HandleId id, + MutableHandleObject objp, MutableHandleShape propp); + static bool obj_lookupProperty(JSContext *cx, HandleObject obj, HandlePropertyName name, + MutableHandleObject objp, MutableHandleShape propp); + static bool obj_lookupElement(JSContext *cx, HandleObject obj, uint32_t index, + MutableHandleObject objp, MutableHandleShape propp); + static bool obj_lookupSpecial(JSContext *cx, HandleObject obj, HandleSpecialId sid, + MutableHandleObject objp, MutableHandleShape propp); + + static bool obj_getGenericAttributes(JSContext *cx, HandleObject obj, + HandleId id, unsigned *attrsp); + static bool obj_getPropertyAttributes(JSContext *cx, HandleObject obj, + HandlePropertyName name, unsigned *attrsp); + static bool obj_getElementAttributes(JSContext *cx, HandleObject obj, + uint32_t index, unsigned *attrsp); + static bool obj_getSpecialAttributes(JSContext *cx, HandleObject obj, + HandleSpecialId sid, unsigned *attrsp); + + static bool obj_setGenericAttributes(JSContext *cx, HandleObject obj, + HandleId id, unsigned *attrsp); + static bool obj_setPropertyAttributes(JSContext *cx, HandleObject obj, + HandlePropertyName name, unsigned *attrsp); + static bool obj_setElementAttributes(JSContext *cx, HandleObject obj, + uint32_t index, unsigned *attrsp); + static bool obj_setSpecialAttributes(JSContext *cx, HandleObject obj, + HandleSpecialId sid, unsigned *attrsp); static Value bufferValue(TypedArrayObject *tarr) { return tarr->getFixedSlot(BUFFER_SLOT); @@ -508,9 +508,9 @@ class DataViewObject : public ArrayBufferViewObject } static bool class_constructor(JSContext *cx, unsigned argc, Value *vp); - static JSBool constructWithProto(JSContext *cx, unsigned argc, Value *vp); - static JSBool construct(JSContext *cx, JSObject *bufobj, const CallArgs &args, - HandleObject proto); + static bool constructWithProto(JSContext *cx, unsigned argc, Value *vp); + static bool construct(JSContext *cx, JSObject *bufobj, const CallArgs &args, + HandleObject proto); static inline DataViewObject * create(JSContext *cx, uint32_t byteOffset, uint32_t byteLength, diff --git a/js/xpconnect/shell/xpcshell.cpp b/js/xpconnect/shell/xpcshell.cpp index a8d16c886d875..73c0d3f2a71f4 100644 --- a/js/xpconnect/shell/xpcshell.cpp +++ b/js/xpconnect/shell/xpcshell.cpp @@ -140,14 +140,14 @@ FILE *gInFile = NULL; int gExitCode = 0; bool gIgnoreReportedErrors = false; -JSBool gQuitting = false; -static JSBool reportWarnings = true; -static JSBool compileOnly = false; +bool gQuitting = false; +static bool reportWarnings = true; +static bool compileOnly = false; JSPrincipals *gJSPrincipals = nullptr; nsAutoString *gWorkingDirectory = nullptr; -static JSBool +static bool GetLocationProperty(JSContext *cx, HandleObject obj, HandleId id, MutableHandleValue vp) { #if !defined(XP_WIN) && !defined(XP_UNIX) @@ -236,7 +236,7 @@ extern JS_EXPORT_API(void) add_history(char *line); } #endif -static JSBool +static bool GetLine(JSContext *cx, char *bufp, FILE *file, const char *prompt) { #ifdef EDITLINE /* @@ -497,7 +497,7 @@ DumpHeap(JSContext *cx, unsigned argc, jsval *vp) size_t maxDepth = (size_t)-1; void *thingToIgnore = NULL; FILE *dumpFile; - JSBool ok; + bool ok; jsval *argv = JS_ARGV(cx, vp); JS_SET_RVAL(cx, vp, JSVAL_VOID); @@ -654,7 +654,7 @@ Options(JSContext *cx, unsigned argc, jsval *vp) uint32_t optset, flag; JSString *str; char *names; - JSBool found; + bool found; optset = 0; jsval *argv = JS_ARGV(cx, vp); @@ -814,7 +814,7 @@ File(JSContext *cx, unsigned argc, jsval *vp) Value sScriptedOperationCallback = UndefinedValue(); -static JSBool +static bool XPCShellOperationCallback(JSContext *cx) { // If no operation callback was set by script, no-op. @@ -909,8 +909,8 @@ JSClass global_class = { JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, nullptr }; -static JSBool -env_setProperty(JSContext *cx, HandleObject obj, HandleId id, JSBool strict, MutableHandleValue vp) +static bool +env_setProperty(JSContext *cx, HandleObject obj, HandleId id, bool strict, MutableHandleValue vp) { /* XXX porting may be easy, but these don't seem to supply setenv by default */ #if !defined XP_OS2 && !defined SOLARIS @@ -963,13 +963,13 @@ env_setProperty(JSContext *cx, HandleObject obj, HandleId id, JSBool strict, Mut return true; } -static JSBool +static bool env_enumerate(JSContext *cx, HandleObject obj) { - static JSBool reflected; + static bool reflected; char **evp, *name, *value; JSString *valstr; - JSBool ok; + bool ok; if (reflected) return true; @@ -995,7 +995,7 @@ env_enumerate(JSContext *cx, HandleObject obj) return true; } -static JSBool +static bool env_resolve(JSContext *cx, HandleObject obj, HandleId id, unsigned flags, JS::MutableHandleObject objp) { @@ -1061,12 +1061,12 @@ my_GetErrorMessage(void *userRef, const char *locale, const unsigned errorNumber static void ProcessFile(JSContext *cx, JS::Handle obj, const char *filename, FILE *file, - JSBool forceTTY) + bool forceTTY) { JSScript *script; JS::Rooted result(cx); int lineno, startline; - JSBool ok, hitEOF; + bool ok, hitEOF; char *bufp, buffer[4096]; JSString *str; @@ -1160,7 +1160,7 @@ ProcessFile(JSContext *cx, JS::Handle obj, const char *filename, FILE } static void -Process(JSContext *cx, JS::Handle obj, const char *filename, JSBool forceTTY) +Process(JSContext *cx, JS::Handle obj, const char *filename, bool forceTTY) { FILE *file; @@ -1231,8 +1231,8 @@ ProcessArgs(JSContext *cx, JS::Handle obj, char **argv, int argc, XPC int i; JS::Rooted argsObj(cx); char *filename = NULL; - JSBool isInteractive = true; - JSBool forceTTY = false; + bool isInteractive = true; + bool forceTTY = false; rcfile = fopen(rcfilename, "r"); if (rcfile) { diff --git a/js/xpconnect/src/XPCCallContext.cpp b/js/xpconnect/src/XPCCallContext.cpp index 6511fc981b413..9922e53d5ce41 100644 --- a/js/xpconnect/src/XPCCallContext.cpp +++ b/js/xpconnect/src/XPCCallContext.cpp @@ -154,7 +154,7 @@ XPCCallContext::SetName(jsid name) void XPCCallContext::SetCallInfo(XPCNativeInterface* iface, XPCNativeMember* member, - JSBool isSetter) + bool isSetter) { CHECK_STATE(HAVE_CONTEXT); diff --git a/js/xpconnect/src/XPCComponents.cpp b/js/xpconnect/src/XPCComponents.cpp index ed4e2e953826a..d179413f2833e 100644 --- a/js/xpconnect/src/XPCComponents.cpp +++ b/js/xpconnect/src/XPCComponents.cpp @@ -54,7 +54,7 @@ static nsresult ThrowAndFail(nsresult errNum, JSContext* cx, bool* retval) return NS_OK; } -static JSBool +static bool JSValIsInterfaceOfType(JSContext *cx, HandleValue v, REFNSIID iid) { @@ -1905,7 +1905,7 @@ struct MOZ_STACK_CLASS ExceptionArgParser bool getOption(HandleObject obj, const char *name, MutableHandleValue rv) { // Look for the property. - JSBool found; + bool found; if (!JS_HasProperty(cx, obj, name, &found)) return false; @@ -2935,16 +2935,16 @@ CreateXMLHttpRequest(JSContext *cx, unsigned argc, jsval *vp) return true; } -static JSBool +static bool sandbox_enumerate(JSContext *cx, HandleObject obj) { return JS_EnumerateStandardClasses(cx, obj); } -static JSBool +static bool sandbox_resolve(JSContext *cx, HandleObject obj, HandleId id) { - JSBool resolved; + bool resolved; return JS_ResolveStandardClass(cx, obj, id, &resolved); } @@ -2959,7 +2959,7 @@ sandbox_finalize(JSFreeOp *fop, JSObject *obj) DestroyProtoAndIfaceCache(obj); } -static JSBool +static bool sandbox_convert(JSContext *cx, HandleObject obj, JSType type, MutableHandleValue vp) { if (type == JSTYPE_OBJECT) { @@ -3125,10 +3125,10 @@ bool BindPropertyOp(JSContext *cx, Op &op, PropertyDescriptor *desc, HandleId id return true; } -extern JSBool +extern bool XPC_WN_Helper_GetProperty(JSContext *cx, HandleObject obj, HandleId id, MutableHandleValue vp); -extern JSBool -XPC_WN_Helper_SetProperty(JSContext *cx, HandleObject obj, HandleId id, JSBool strict, MutableHandleValue vp); +extern bool +XPC_WN_Helper_SetProperty(JSContext *cx, HandleObject obj, HandleId id, bool strict, MutableHandleValue vp); bool xpc::SandboxProxyHandler::getPropertyDescriptor(JSContext *cx, @@ -3523,7 +3523,7 @@ GetExpandedPrincipal(JSContext *cx, HandleObject arrayObj, nsIExpandedPrincipal // helper that tries to get a property form the options object nsresult GetPropFromOptions(JSContext *cx, HandleObject from, const char *name, MutableHandleValue prop, - JSBool *found) + bool *found) { if (!JS_HasProperty(cx, from, name, found)) return NS_ERROR_INVALID_ARG; @@ -3542,7 +3542,7 @@ GetBoolPropFromOptions(JSContext *cx, HandleObject from, const char *name, bool RootedValue value(cx); - JSBool found; + bool found; if (NS_FAILED(GetPropFromOptions(cx, from, name, &value, &found))) return NS_ERROR_INVALID_ARG; @@ -3563,7 +3563,7 @@ GetObjPropFromOptions(JSContext *cx, HandleObject from, const char *name, JSObje MOZ_ASSERT(prop); RootedValue value(cx); - JSBool found; + bool found; if (NS_FAILED(GetPropFromOptions(cx, from, name, &value, &found))) return NS_ERROR_INVALID_ARG; @@ -3584,7 +3584,7 @@ nsresult GetStringPropFromOptions(JSContext *cx, HandleObject from, const char *name, nsCString &prop) { RootedValue value(cx); - JSBool found; + bool found; nsresult rv = GetPropFromOptions(cx, from, name, &value, &found); NS_ENSURE_SUCCESS(rv, rv); @@ -3737,7 +3737,7 @@ class ContextHolder : public nsIScriptObjectPrincipal NS_DECL_ISUPPORTS private: - static JSBool ContextHolderOperationCallback(JSContext *cx); + static bool ContextHolderOperationCallback(JSContext *cx); JSContext* mJSContext; JSContext* mOrigCx; @@ -3775,7 +3775,7 @@ ContextHolder::~ContextHolder() JS_DestroyContextNoGC(mJSContext); } -JSBool +bool ContextHolder::ContextHolderOperationCallback(JSContext *cx) { ContextHolder* thisObject = @@ -3784,7 +3784,7 @@ ContextHolder::ContextHolderOperationCallback(JSContext *cx) JSContext *origCx = thisObject->mOrigCx; JSOperationCallback callback = JS_GetOperationCallback(origCx); - JSBool ok = true; + bool ok = true; if (callback) ok = callback(origCx); return ok; @@ -4240,7 +4240,7 @@ FunctionWrapper(JSContext *cx, unsigned argc, Value *vp) return JS_CallFunctionValue(cx, obj, v, args.length(), args.array(), vp); } -JSBool +bool WrapCallable(JSContext *cx, HandleObject obj, HandleId id, HandleObject propobj, MutableHandleValue vp) { @@ -4856,7 +4856,7 @@ nsXPCComponents::SetProperty(nsIXPConnectWrappedNative *wrapper, return NS_ERROR_XPC_CANT_MODIFY_PROP_ON_WN; } -static JSBool +static bool ContentComponentsGetterOp(JSContext *cx, HandleObject obj, HandleId id, MutableHandleValue vp) { @@ -4886,7 +4886,7 @@ ContentComponentsGetterOp(JSContext *cx, HandleObject obj, HandleId id, } // static -JSBool +bool nsXPCComponents::AttachComponentsObject(JSContext* aCx, XPCWrappedNativeScope* aScope) { diff --git a/js/xpconnect/src/XPCConvert.cpp b/js/xpconnect/src/XPCConvert.cpp index 806ea9bddcd2e..60f062eb65a67 100644 --- a/js/xpconnect/src/XPCConvert.cpp +++ b/js/xpconnect/src/XPCConvert.cpp @@ -45,7 +45,7 @@ using namespace JS; /***********************************************************/ // static -JSBool +bool XPCConvert::IsMethodReflectable(const XPTMethodDescriptor& info) { if (XPT_MD_IS_NOTXPCOM(info.flags) || XPT_MD_IS_HIDDEN(info.flags)) @@ -78,7 +78,7 @@ UnwrapNativeCPOW(nsISupports* wrapper) /***************************************************************************/ // static -JSBool +bool XPCConvert::GetISupportsFromJSObject(JSObject* obj, nsISupports** iface) { JSClass* jsclass = js::GetObjectJSClass(obj); @@ -96,7 +96,7 @@ XPCConvert::GetISupportsFromJSObject(JSObject* obj, nsISupports** iface) /***************************************************************************/ // static -JSBool +bool XPCConvert::NativeData2JS(jsval* d, const void* s, const nsXPTType& type, const nsID* iid, nsresult* pErr) { @@ -377,15 +377,15 @@ bool ConvertToPrimitive(JSContext *cx, HandleValue v, T *retval) } // static -JSBool +bool XPCConvert::JSData2Native(void* d, HandleValue s, const nsXPTType& type, - JSBool useAllocator, const nsID* iid, + bool useAllocator, const nsID* iid, nsresult* pErr) { NS_PRECONDITION(d, "bad param"); - JSBool isDOMString = true; + bool isDOMString = true; AutoJSContext cx; if (pErr) @@ -489,7 +489,7 @@ XPCConvert::JSData2Native(void* d, HandleValue s, const PRUnichar* chars = nullptr; JSString* str = nullptr; - JSBool isNewString = false; + bool isNewString = false; uint32_t length = 0; if (JSVAL_IS_VOID(s)) { @@ -772,7 +772,7 @@ XPCConvert::JSData2Native(void* d, HandleValue s, return true; } -inline JSBool +inline bool CreateHolderIfNeeded(HandleObject obj, jsval* d, nsIXPConnectJSObjectHolder** dest) { @@ -791,7 +791,7 @@ CreateHolderIfNeeded(HandleObject obj, jsval* d, /***************************************************************************/ // static -JSBool +bool XPCConvert::NativeInterface2JSObject(jsval* d, nsIXPConnectJSObjectHolder** dest, xpcObjectHelper& aHelper, @@ -960,7 +960,7 @@ XPCConvert::NativeInterface2JSObject(jsval* d, /***************************************************************************/ // static -JSBool +bool XPCConvert::JSObject2NativeInterface(void** dest, HandleObject src, const nsID* iid, nsISupports* aOuter, @@ -1169,7 +1169,7 @@ XPCConvert::JSValToXPCException(MutableHandleValue s, unsigned ignored; - JSBool found; + bool found; // heuristic to see if it might be usable as an xpcexception if (!JS_GetPropertyAttributes(cx, obj, "message", &ignored, &found)) @@ -1223,7 +1223,7 @@ XPCConvert::JSValToXPCException(MutableHandleValue s, // lets see if it looks like an nsresult nsresult rv; double number; - JSBool isResult = false; + bool isResult = false; if (JSVAL_IS_INT(s)) { rv = (nsresult) JSVAL_TO_INT(s); @@ -1268,7 +1268,7 @@ XPCConvert::JSValToXPCException(MutableHandleValue s, } // otherwise we'll just try to convert it to a string - // Note: e.g., JSBools get converted to JSStrings by this code. + // Note: e.g., bools get converted to JSStrings by this code. JSString* str = JS_ValueToString(cx, s); if (str) { @@ -1344,7 +1344,7 @@ XPCConvert::JSErrorToXPCException(const char* message, #endif // static -JSBool +bool XPCConvert::NativeArray2JS(jsval* d, const void** s, const nsXPTType& type, const nsID* iid, uint32_t count, nsresult* pErr) @@ -1423,7 +1423,7 @@ XPCConvert::NativeArray2JS(jsval* d, const void** s, // of the array. If the check succeeds, check that the size // of the output does not exceed UINT32_MAX bytes. Allocate // the memory and copy the elements by memcpy. -static JSBool +static bool CheckTargetAndPopulate(const nsXPTType& type, uint8_t requiredType, size_t typeSize, @@ -1469,7 +1469,7 @@ CheckTargetAndPopulate(const nsXPTType& type, // are not supported. // static -JSBool +bool XPCConvert::JSTypedArray2Native(void** d, JSObject* jsArray, uint32_t count, @@ -1574,7 +1574,7 @@ XPCConvert::JSTypedArray2Native(void** d, } // static -JSBool +bool XPCConvert::JSArray2Native(void** d, HandleValue s, uint32_t count, const nsXPTType& type, const nsID* iid, nsresult* pErr) @@ -1714,7 +1714,7 @@ XPCConvert::JSArray2Native(void** d, HandleValue s, } // static -JSBool +bool XPCConvert::NativeStringWithSize2JS(jsval* d, const void* s, const nsXPTType& type, uint32_t count, @@ -1758,7 +1758,7 @@ XPCConvert::NativeStringWithSize2JS(jsval* d, const void* s, } // static -JSBool +bool XPCConvert::JSStringWithSize2Native(void* d, HandleValue s, uint32_t count, const nsXPTType& type, nsresult* pErr) diff --git a/js/xpconnect/src/XPCDebug.cpp b/js/xpconnect/src/XPCDebug.cpp index cbdeacd0fb27c..ce48d43f3ec13 100644 --- a/js/xpconnect/src/XPCDebug.cpp +++ b/js/xpconnect/src/XPCDebug.cpp @@ -30,8 +30,8 @@ static void DebugDump(const char* fmt, ...) printf("%s", buffer); } -JSBool -xpc_DumpJSStack(JSContext* cx, JSBool showArgs, JSBool showLocals, JSBool showThisProps) +bool +xpc_DumpJSStack(JSContext* cx, bool showArgs, bool showLocals, bool showThisProps) { if (char* buf = xpc_PrintJSStack(cx, showArgs, showLocals, showThisProps)) { DebugDump("%s\n", buf); @@ -41,8 +41,8 @@ xpc_DumpJSStack(JSContext* cx, JSBool showArgs, JSBool showLocals, JSBool showTh } char* -xpc_PrintJSStack(JSContext* cx, JSBool showArgs, JSBool showLocals, - JSBool showThisProps) +xpc_PrintJSStack(JSContext* cx, bool showArgs, bool showLocals, + bool showThisProps) { char* buf; JSExceptionState *state = JS_SaveExceptionState(cx); @@ -68,7 +68,7 @@ xpcDumpEvalErrorReporter(JSContext *cx, const char *message, DebugDump("Error: %s\n", message); } -JSBool +bool xpc_DumpEvalInJSStackFrame(JSContext* cx, uint32_t frameno, const char* text) { if (!cx || !text) { @@ -129,7 +129,7 @@ xpc_DebuggerKeywordHandler(JSContext *cx, JSScript *script, jsbytecode *pc, return JSTRAP_CONTINUE; } -JSBool xpc_InstallJSDebuggerKeywordHandler(JSRuntime* rt) +bool xpc_InstallJSDebuggerKeywordHandler(JSRuntime* rt) { return JS_SetDebuggerHandler(rt, xpc_DebuggerKeywordHandler, nullptr); } diff --git a/js/xpconnect/src/XPCException.cpp b/js/xpconnect/src/XPCException.cpp index 0e593ad2d63e4..580d6dc9d7685 100644 --- a/js/xpconnect/src/XPCException.cpp +++ b/js/xpconnect/src/XPCException.cpp @@ -31,7 +31,7 @@ static const struct ResultMap #define RESULT_COUNT ((sizeof(map) / sizeof(map[0]))-1) // static -JSBool +bool nsXPCException::NameAndFormatForNSResult(nsresult rv, const char** name, const char** format) @@ -365,7 +365,7 @@ nsXPCException::ToString(char **_retval) return final ? NS_OK : NS_ERROR_OUT_OF_MEMORY; } -JSBool nsXPCException::sEverMadeOneFromFactory = false; +bool nsXPCException::sEverMadeOneFromFactory = false; // static nsresult diff --git a/js/xpconnect/src/XPCInlines.h b/js/xpconnect/src/XPCInlines.h index a88a04f79dcc8..13feeb87869f4 100644 --- a/js/xpconnect/src/XPCInlines.h +++ b/js/xpconnect/src/XPCInlines.h @@ -34,7 +34,7 @@ XPCJSRuntime::AddObjectHolderRoot(XPCJSObjectHolder* holder) /***************************************************************************/ -inline JSBool +inline bool XPCCallContext::IsValid() const { return mState != INIT_FAILED; @@ -117,7 +117,7 @@ XPCCallContext::GetProto() const return mWrapper ? mWrapper->GetProto() : nullptr; } -inline JSBool +inline bool XPCCallContext::CanGetTearOff() const { return mState >= HAVE_OBJECT; @@ -137,7 +137,7 @@ XPCCallContext::GetScriptableInfo() const return mScriptableInfo; } -inline JSBool +inline bool XPCCallContext::CanGetSet() const { return mState >= HAVE_NAME; @@ -150,7 +150,7 @@ XPCCallContext::GetSet() const return mSet; } -inline JSBool +inline bool XPCCallContext::CanGetInterface() const { return mState >= HAVE_NAME; @@ -170,7 +170,7 @@ XPCCallContext::GetMember() const return mMember; } -inline JSBool +inline bool XPCCallContext::HasInterfaceAndMember() const { return mState >= HAVE_NAME && mInterface && mMember; @@ -183,7 +183,7 @@ XPCCallContext::GetName() const return mName; } -inline JSBool +inline bool XPCCallContext::GetStaticMemberIsLocal() const { CHECK_STATE(HAVE_NAME); @@ -287,7 +287,7 @@ XPCNativeInterface::FindMember(jsid name) const return nullptr; } -inline JSBool +inline bool XPCNativeInterface::HasAncestor(const nsIID* iid) const { bool found = false; @@ -297,7 +297,7 @@ XPCNativeInterface::HasAncestor(const nsIID* iid) const /***************************************************************************/ -inline JSBool +inline bool XPCNativeSet::FindMember(jsid name, XPCNativeMember** pMember, uint16_t* pInterfaceIndex) const { @@ -331,7 +331,7 @@ XPCNativeSet::FindMember(jsid name, XPCNativeMember** pMember, return false; } -inline JSBool +inline bool XPCNativeSet::FindMember(jsid name, XPCNativeMember** pMember, XPCNativeInterface** pInterface) const { @@ -342,12 +342,12 @@ XPCNativeSet::FindMember(jsid name, XPCNativeMember** pMember, return true; } -inline JSBool +inline bool XPCNativeSet::FindMember(jsid name, XPCNativeMember** pMember, XPCNativeInterface** pInterface, XPCNativeSet* protoSet, - JSBool* pIsLocal) const + bool* pIsLocal) const { XPCNativeMember* Member; XPCNativeInterface* Interface; @@ -398,7 +398,7 @@ XPCNativeSet::FindInterfaceWithIID(const nsIID& iid) const return nullptr; } -inline JSBool +inline bool XPCNativeSet::HasInterface(XPCNativeInterface* aInterface) const { XPCNativeInterface* const * pp = mInterfaces; @@ -410,13 +410,13 @@ XPCNativeSet::HasInterface(XPCNativeInterface* aInterface) const return false; } -inline JSBool +inline bool XPCNativeSet::HasInterfaceWithAncestor(XPCNativeInterface* aInterface) const { return HasInterfaceWithAncestor(aInterface->GetIID()); } -inline JSBool +inline bool XPCNativeSet::HasInterfaceWithAncestor(const nsIID* iid) const { // We can safely skip the first interface which is *always* nsISupports. @@ -432,7 +432,7 @@ XPCNativeSet::HasInterfaceWithAncestor(const nsIID* iid) const return false; } -inline JSBool +inline bool XPCNativeSet::MatchesSetUpToInterface(const XPCNativeSet* other, XPCNativeInterface* iface) const { @@ -508,7 +508,7 @@ XPCWrappedNativeTearOff::~XPCWrappedNativeTearOff() /***************************************************************************/ -inline JSBool +inline bool XPCWrappedNative::HasInterfaceNoQI(const nsIID& iid) { return nullptr != GetSet()->FindInterfaceWithIID(iid); @@ -521,7 +521,7 @@ XPCWrappedNative::SweepTearOffs() for (chunk = &mFirstChunk; chunk; chunk = chunk->mNextChunk) { XPCWrappedNativeTearOff* to = chunk->mTearOffs; for (int i = XPC_WRAPPED_NATIVE_TEAROFFS_PER_CHUNK; i > 0; i--, to++) { - JSBool marked = to->IsMarked(); + bool marked = to->IsMarked(); to->Unmark(); if (marked) continue; @@ -542,7 +542,7 @@ XPCWrappedNative::SweepTearOffs() /***************************************************************************/ -inline JSBool +inline bool xpc_ForcePropertyResolve(JSContext* cx, JSObject* obj, jsid id) { JS::RootedValue prop(cx); @@ -560,7 +560,7 @@ GetRTIdByIndex(JSContext *cx, unsigned index) } inline -JSBool ThrowBadParam(nsresult rv, unsigned paramNum, XPCCallContext& ccx) +bool ThrowBadParam(nsresult rv, unsigned paramNum, XPCCallContext& ccx) { XPCThrower::ThrowBadParam(rv, paramNum, ccx); return false; diff --git a/js/xpconnect/src/XPCJSContextStack.cpp b/js/xpconnect/src/XPCJSContextStack.cpp index 89caaa71ce79f..f5b987d6b2afa 100644 --- a/js/xpconnect/src/XPCJSContextStack.cpp +++ b/js/xpconnect/src/XPCJSContextStack.cpp @@ -104,10 +104,10 @@ XPCJSContextStack::HasJSContext(JSContext *cx) return false; } -static JSBool +static bool SafeGlobalResolve(JSContext *cx, HandleObject obj, HandleId id) { - JSBool resolved; + bool resolved; return JS_ResolveStandardClass(cx, obj, id, &resolved); } diff --git a/js/xpconnect/src/XPCJSID.cpp b/js/xpconnect/src/XPCJSID.cpp index dab373a2fc15b..35ed6405176ca 100644 --- a/js/xpconnect/src/XPCJSID.cpp +++ b/js/xpconnect/src/XPCJSID.cpp @@ -915,7 +915,7 @@ xpc_JSObjectToID(JSContext *cx, JSObject* obj) return nullptr; } -JSBool +bool xpc_JSObjectIsID(JSContext *cx, JSObject* obj) { NS_ASSERTION(cx && obj, "bad param"); diff --git a/js/xpconnect/src/XPCJSRuntime.cpp b/js/xpconnect/src/XPCJSRuntime.cpp index a5751fb20fc7d..5bb5641bd9ca8 100644 --- a/js/xpconnect/src/XPCJSRuntime.cpp +++ b/js/xpconnect/src/XPCJSRuntime.cpp @@ -659,7 +659,7 @@ XPCJSRuntime::CustomGCCallback(JSGCStatus status) } /* static */ void -XPCJSRuntime::FinalizeCallback(JSFreeOp *fop, JSFinalizeStatus status, JSBool isCompartmentGC) +XPCJSRuntime::FinalizeCallback(JSFreeOp *fop, JSFinalizeStatus status, bool isCompartmentGC) { XPCJSRuntime* self = nsXPConnect::GetRuntimeInstance(); if (!self) @@ -1206,7 +1206,7 @@ xpc::SimulateActivityCallback(bool aActive) //static void -XPCJSRuntime::ActivityCallback(void *arg, JSBool active) +XPCJSRuntime::ActivityCallback(void *arg, bool active) { XPCJSRuntime* self = static_cast(arg); self->mWatchdogManager->RecordRuntimeActivity(active); @@ -2616,7 +2616,7 @@ JSMemoryMultiReporter::CollectReports(WindowPaths *windowPaths, } // namespace xpc #ifdef MOZ_CRASHREPORTER -static JSBool +static bool DiagnosticMemoryCallback(void *ptr, size_t size) { return CrashReporter::RegisterAppMemory(ptr, size) == NS_OK; @@ -2947,7 +2947,7 @@ XPCJSRuntime::newXPCJSRuntime(nsXPConnect* aXPConnect) // InternStaticDictionaryJSVals is automatically generated. bool InternStaticDictionaryJSVals(JSContext* aCx); -JSBool +bool XPCJSRuntime::OnJSContextNew(JSContext *cx) { // If we were the first cx ever created (like the SafeJSContext), the caller diff --git a/js/xpconnect/src/XPCLocale.cpp b/js/xpconnect/src/XPCLocale.cpp index 1e921aa27c233..abbde480284cd 100644 --- a/js/xpconnect/src/XPCLocale.cpp +++ b/js/xpconnect/src/XPCLocale.cpp @@ -73,32 +73,32 @@ struct XPCLocaleCallbacks : public JSLocaleCallbacks return ths; } - static JSBool + static bool LocaleToUpperCase(JSContext *cx, HandleString src, MutableHandleValue rval) { return ChangeCase(cx, src, rval, ToUpperCase); } - static JSBool + static bool LocaleToLowerCase(JSContext *cx, HandleString src, MutableHandleValue rval) { return ChangeCase(cx, src, rval, ToLowerCase); } - static JSBool + static bool LocaleToUnicode(JSContext* cx, const char* src, MutableHandleValue rval) { return This(JS_GetRuntime(cx))->ToUnicode(cx, src, rval); } - static JSBool + static bool LocaleCompare(JSContext *cx, HandleString src1, HandleString src2, MutableHandleValue rval) { return This(JS_GetRuntime(cx))->Compare(cx, src1, src2, rval); } private: - static JSBool + static bool ChangeCase(JSContext* cx, HandleString src, MutableHandleValue rval, void(*changeCaseFnc)(const nsAString&, nsAString&)) { @@ -120,7 +120,7 @@ struct XPCLocaleCallbacks : public JSLocaleCallbacks return true; } - JSBool + bool Compare(JSContext *cx, HandleString src1, HandleString src2, MutableHandleValue rval) { nsresult rv; @@ -167,7 +167,7 @@ struct XPCLocaleCallbacks : public JSLocaleCallbacks return true; } - JSBool + bool ToUnicode(JSContext* cx, const char* src, MutableHandleValue rval) { nsresult rv; diff --git a/js/xpconnect/src/XPCMaps.cpp b/js/xpconnect/src/XPCMaps.cpp index 2fe53f177fe73..6201be7da430c 100644 --- a/js/xpconnect/src/XPCMaps.cpp +++ b/js/xpconnect/src/XPCMaps.cpp @@ -582,7 +582,7 @@ XPCNativeScriptableSharedMap::~XPCNativeScriptableSharedMap() PL_DHashTableDestroy(mTable); } -JSBool +bool XPCNativeScriptableSharedMap::GetNewOrUsed(uint32_t flags, char* name, uint32_t interfacesBitmap, diff --git a/js/xpconnect/src/XPCMaps.h b/js/xpconnect/src/XPCMaps.h index 1a8152658f42a..8b36249009f5c 100644 --- a/js/xpconnect/src/XPCMaps.h +++ b/js/xpconnect/src/XPCMaps.h @@ -564,8 +564,8 @@ class XPCNativeScriptableSharedMap static XPCNativeScriptableSharedMap* newMap(int size); - JSBool GetNewOrUsed(uint32_t flags, char* name, uint32_t interfacesBitmap, - XPCNativeScriptableInfo* si); + bool GetNewOrUsed(uint32_t flags, char* name, uint32_t interfacesBitmap, + XPCNativeScriptableInfo* si); inline uint32_t Count() {return mTable->entryCount;} inline uint32_t Enumerate(PLDHashEnumerator f, void *arg) diff --git a/js/xpconnect/src/XPCQuickStubs.cpp b/js/xpconnect/src/XPCQuickStubs.cpp index 4c25cace295c1..ee877dae1aa14 100644 --- a/js/xpconnect/src/XPCQuickStubs.cpp +++ b/js/xpconnect/src/XPCQuickStubs.cpp @@ -90,7 +90,7 @@ PointerHolderClass = { JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, PointerFinalize }; -JSBool +bool xpc_qsDefineQuickStubs(JSContext *cx, JSObject *protoArg, unsigned flags, uint32_t ifacec, const nsIID **interfaces, uint32_t tableSize, const xpc_qsHashEntry *table, @@ -153,7 +153,7 @@ xpc_qsDefineQuickStubs(JSContext *cx, JSObject *protoArg, unsigned flags, return true; } -JSBool +bool xpc_qsThrow(JSContext *cx, nsresult rv) { XPCThrower::Throw(rv, cx); @@ -257,7 +257,7 @@ ThrowCallFailed(JSContext *cx, nsresult rv, return false; } -JSBool +bool xpc_qsThrowGetterSetterFailed(JSContext *cx, nsresult rv, JSObject *obj, jsid memberIdArg) { @@ -267,7 +267,7 @@ xpc_qsThrowGetterSetterFailed(JSContext *cx, nsresult rv, JSObject *obj, return ThrowCallFailed(cx, rv, ifaceName, memberId, NULL); } -JSBool +bool xpc_qsThrowGetterSetterFailed(JSContext *cx, nsresult rv, JSObject *objArg, const char* memberName) { @@ -280,7 +280,7 @@ xpc_qsThrowGetterSetterFailed(JSContext *cx, nsresult rv, JSObject *objArg, INTERNED_STRING_TO_JSID(cx, str)); } -JSBool +bool xpc_qsThrowGetterSetterFailed(JSContext *cx, nsresult rv, JSObject *obj, uint16_t memberIndex) { @@ -288,7 +288,7 @@ xpc_qsThrowGetterSetterFailed(JSContext *cx, nsresult rv, JSObject *obj, xpc_qsStringTable + memberIndex); } -JSBool +bool xpc_qsThrowMethodFailed(JSContext *cx, nsresult rv, jsval *vp) { const char *ifaceName; @@ -297,7 +297,7 @@ xpc_qsThrowMethodFailed(JSContext *cx, nsresult rv, jsval *vp) return ThrowCallFailed(cx, rv, ifaceName, memberId, NULL); } -JSBool +bool xpc_qsThrowMethodFailedWithCcx(XPCCallContext &ccx, nsresult rv) { ThrowBadResult(rv, ccx); @@ -392,8 +392,8 @@ xpc_qsThrowBadSetterValue(JSContext *cx, nsresult rv, JSObject *obj, xpc_qsThrowBadSetterValue(cx, rv, obj, xpc_qsStringTable + name_index); } -JSBool -xpc_qsGetterOnlyPropertyStub(JSContext *cx, HandleObject obj, HandleId id, JSBool strict, +bool +xpc_qsGetterOnlyPropertyStub(JSContext *cx, HandleObject obj, HandleId id, bool strict, MutableHandleValue vp) { return JS_ReportErrorFlagsAndNumber(cx, @@ -653,7 +653,7 @@ castNativeFromWrapper(JSContext *cx, return native; } -JSBool +bool xpc_qsUnwrapThisFromCcxImpl(XPCCallContext &ccx, const nsIID &iid, void **ppThis, @@ -741,7 +741,7 @@ xpc_qsUnwrapArgImpl(JSContext *cx, return rv; } -JSBool +bool xpc_qsJsvalToCharStr(JSContext *cx, jsval v, JSAutoByteString *bytes) { JSString *str; @@ -758,7 +758,7 @@ xpc_qsJsvalToCharStr(JSContext *cx, jsval v, JSAutoByteString *bytes) return !!bytes->encodeLatin1(cx, str); } -JSBool +bool xpc_qsJsvalToWcharStr(JSContext *cx, jsval v, jsval *pval, const PRUnichar **pstr) { JSString *str; @@ -802,7 +802,7 @@ NonVoidStringToJsval(JSContext *cx, nsAString &str, JS::Value *rval) } // namespace xpc -JSBool +bool xpc_qsStringToJsstring(JSContext *cx, nsString &str, JSString **rval) { // From the T_DOMSTRING case in XPCConvert::NativeData2JS. @@ -824,7 +824,7 @@ xpc_qsStringToJsstring(JSContext *cx, nsString &str, JSString **rval) return true; } -JSBool +bool xpc_qsXPCOMObjectToJsval(JSContext *cx, qsObjectHelper &aHelper, const nsIID *iid, XPCNativeInterface **iface, jsval *rval) @@ -856,7 +856,7 @@ xpc_qsXPCOMObjectToJsval(JSContext *cx, qsObjectHelper &aHelper, return true; } -JSBool +bool xpc_qsVariantToJsval(JSContext *aCx, nsIVariant *p, jsval *rval) @@ -865,7 +865,7 @@ xpc_qsVariantToJsval(JSContext *aCx, // Error handling is in XPCWrappedNative::CallMethod. if (p) { nsresult rv; - JSBool ok = XPCVariant::VariantDataToJS(p, &rv, rval); + bool ok = XPCVariant::VariantDataToJS(p, &rv, rval); if (!ok) xpc_qsThrow(aCx, rv); return ok; diff --git a/js/xpconnect/src/XPCQuickStubs.h b/js/xpconnect/src/XPCQuickStubs.h index d81babe33d1ba..52d77768171e9 100644 --- a/js/xpconnect/src/XPCQuickStubs.h +++ b/js/xpconnect/src/XPCQuickStubs.h @@ -46,7 +46,7 @@ struct xpc_qsHashEntry { uint16_t chain; }; -JSBool +bool xpc_qsDefineQuickStubs(JSContext *cx, JSObject *proto, unsigned extraFlags, uint32_t ifacec, const nsIID **interfaces, uint32_t tableSize, const xpc_qsHashEntry *table, @@ -55,7 +55,7 @@ xpc_qsDefineQuickStubs(JSContext *cx, JSObject *proto, unsigned extraFlags, const char *stringTable); /** Raise an exception on @a cx and return false. */ -JSBool +bool xpc_qsThrow(JSContext *cx, nsresult rv); /** @@ -71,14 +71,14 @@ xpc_qsThrow(JSContext *cx, nsresult rv); * receives the wrapper JSObject. (The other reason is to help the caller keep * that JSObject GC-reachable.) */ -JSBool +bool xpc_qsThrowGetterSetterFailed(JSContext *cx, nsresult rv, JSObject *obj, jsid memberId); // And variants using strings and string tables -JSBool +bool xpc_qsThrowGetterSetterFailed(JSContext *cx, nsresult rv, JSObject *obj, const char* memberName); -JSBool +bool xpc_qsThrowGetterSetterFailed(JSContext *cx, nsresult rv, JSObject *obj, uint16_t memberIndex); @@ -87,10 +87,10 @@ xpc_qsThrowGetterSetterFailed(JSContext *cx, nsresult rv, * * See NOTE at xpc_qsThrowGetterSetterFailed. */ -JSBool +bool xpc_qsThrowMethodFailed(JSContext *cx, nsresult rv, jsval *vp); -JSBool +bool xpc_qsThrowMethodFailedWithCcx(XPCCallContext &ccx, nsresult rv); bool @@ -130,23 +130,23 @@ xpc_qsThrowBadSetterValue(JSContext *cx, nsresult rv, JSObject *obj, uint16_t name_index); -JSBool +bool xpc_qsGetterOnlyPropertyStub(JSContext *cx, JS::HandleObject obj, JS::HandleId id, - JSBool strict, JS::MutableHandleValue vp); + bool strict, JS::MutableHandleValue vp); bool xpc_qsGetterOnlyNativeStub(JSContext *cx, unsigned argc, jsval *vp); /* Functions for converting values between COM and JS. */ -inline JSBool +inline bool xpc_qsInt64ToJsval(JSContext *cx, int64_t i, jsval *rv) { *rv = JS_NumberValue(static_cast(i)); return true; } -inline JSBool +inline bool xpc_qsUint64ToJsval(JSContext *cx, uint64_t u, jsval *rv) { *rv = JS_NumberValue(static_cast(u)); @@ -169,7 +169,7 @@ class xpc_qsBasicString Ptr()->~implementation_type(); } - JSBool IsValid() const { return mValid; } + bool IsValid() const { return mValid; } implementation_type *Ptr() { @@ -222,7 +222,7 @@ class xpc_qsBasicString * stored in mBuf, if mValid is true. */ void *mBuf[JS_HOWMANY(sizeof(implementation_type), sizeof(void *))]; - JSBool mValid; + bool mValid; /* * If null is returned, then we either failed or fully initialized @@ -347,15 +347,15 @@ struct xpc_qsSelfRef * Out. On success it receives the converted string unless v is null or * undefinedin which case bytes->ptr() remains null. */ -JSBool +bool xpc_qsJsvalToCharStr(JSContext *cx, jsval v, JSAutoByteString *bytes); -JSBool +bool xpc_qsJsvalToWcharStr(JSContext *cx, jsval v, jsval *pval, const PRUnichar **pstr); /** Convert an nsString to JSString, returning true on success. This will sometimes modify |str| to be empty. */ -JSBool +bool xpc_qsStringToJsstring(JSContext *cx, nsString &str, JSString **rval); nsresult @@ -392,7 +392,7 @@ castNative(JSContext *cx, * Requires a request on @a cx. */ template -inline JSBool +inline bool xpc_qsUnwrapThis(JSContext *cx, JS::HandleObject obj, T **ppThis, @@ -426,7 +426,7 @@ castNativeFromWrapper(JSContext *cx, jsval *pVal, nsresult *rv); -JSBool +bool xpc_qsUnwrapThisFromCcxImpl(XPCCallContext &ccx, const nsIID &iid, void **ppThis, @@ -438,7 +438,7 @@ xpc_qsUnwrapThisFromCcxImpl(XPCCallContext &ccx, * present in the given XPCCallContext. */ template -inline JSBool +inline bool xpc_qsUnwrapThisFromCcx(XPCCallContext &ccx, T **ppThis, nsISupports **pThisRef, @@ -526,7 +526,7 @@ xpc_qsGetWrapperCache(void *p) * aIdentity is a performance optimization. Set it to true, * only if p is the identity pointer. */ -JSBool +bool xpc_qsXPCOMObjectToJsval(JSContext *aCx, qsObjectHelper &aHelper, const nsIID *iid, @@ -536,7 +536,7 @@ xpc_qsXPCOMObjectToJsval(JSContext *aCx, /** * Convert a variant to jsval. Return true on success. */ -JSBool +bool xpc_qsVariantToJsval(JSContext *cx, nsIVariant *p, jsval *rval); @@ -570,11 +570,11 @@ xpc_qsSameResult(int32_t result1, int32_t result2) // Apply |op| to |obj|, |id|, and |vp|. If |op| is a setter, treat the assignment as lenient. template -inline JSBool ApplyPropertyOp(JSContext *cx, Op op, JS::HandleObject obj, JS::HandleId id, +inline bool ApplyPropertyOp(JSContext *cx, Op op, JS::HandleObject obj, JS::HandleId id, JS::MutableHandleValue vp); template<> -inline JSBool +inline bool ApplyPropertyOp(JSContext *cx, JSPropertyOp op, JS::HandleObject obj, JS::HandleId id, JS::MutableHandleValue vp) { @@ -582,7 +582,7 @@ ApplyPropertyOp(JSContext *cx, JSPropertyOp op, JS::HandleObject o } template<> -inline JSBool +inline bool ApplyPropertyOp(JSContext *cx, JSStrictPropertyOp op, JS::HandleObject obj, JS::HandleId id, JS::MutableHandleValue vp) { diff --git a/js/xpconnect/src/XPCRuntimeService.cpp b/js/xpconnect/src/XPCRuntimeService.cpp index 6e3644610d3c4..f7d6d7265dbc9 100644 --- a/js/xpconnect/src/XPCRuntimeService.cpp +++ b/js/xpconnect/src/XPCRuntimeService.cpp @@ -50,7 +50,7 @@ BackstagePass::NewResolve(nsIXPConnectWrappedNative *wrapper, JS::RootedObject obj(cx, objArg); JS::RootedId id(cx, idArg); - JSBool resolved; + bool resolved; *_retval = !!JS_ResolveStandardClass(cx, obj, id, &resolved); if (!*_retval) { diff --git a/js/xpconnect/src/XPCStack.cpp b/js/xpconnect/src/XPCStack.cpp index 1e79a2160142b..7bc1a83fe61d9 100644 --- a/js/xpconnect/src/XPCStack.cpp +++ b/js/xpconnect/src/XPCStack.cpp @@ -26,7 +26,7 @@ class XPCJSStackFrame : public nsIStackFrame XPCJSStackFrame(); virtual ~XPCJSStackFrame(); - JSBool IsJSFrame() const + bool IsJSFrame() const {return mLanguage == nsIProgrammingLanguage::JAVASCRIPT;} private: @@ -149,7 +149,7 @@ XPCJSStackFrame::CreateStackFrameLocation(uint32_t aLanguage, nsIStackFrame* aCaller, XPCJSStackFrame** stack) { - JSBool failed = false; + bool failed = false; XPCJSStackFrame* self = new XPCJSStackFrame(); if (self) NS_ADDREF(self); diff --git a/js/xpconnect/src/XPCThrower.cpp b/js/xpconnect/src/XPCThrower.cpp index f5ec7557b0538..b9169dd25d77d 100644 --- a/js/xpconnect/src/XPCThrower.cpp +++ b/js/xpconnect/src/XPCThrower.cpp @@ -10,7 +10,7 @@ #include "xpcpublic.h" #include "XPCWrapper.h" -JSBool XPCThrower::sVerbose = true; +bool XPCThrower::sVerbose = true; // static void @@ -41,7 +41,7 @@ Throw(JSContext *cx, nsresult rv) * should be the current call context. */ // static -JSBool +bool XPCThrower::CheckForPendingException(nsresult result, JSContext *cx) { nsCOMPtr e; @@ -172,7 +172,7 @@ XPCThrower::Verbosify(XPCCallContext& ccx, void XPCThrower::BuildAndThrowException(JSContext* cx, nsresult rv, const char* sz) { - JSBool success = false; + bool success = false; /* no need to set an expection if the security manager already has */ if (rv == NS_ERROR_XPC_SECURITY_MANAGER_VETO && JS_IsExceptionPending(cx)) @@ -222,10 +222,10 @@ IsCallerChrome(JSContext* cx) } // static -JSBool +bool XPCThrower::ThrowExceptionObject(JSContext* cx, nsIException* e) { - JSBool success = false; + bool success = false; if (e) { nsCOMPtr xpcEx; JS::RootedValue thrown(cx); diff --git a/js/xpconnect/src/XPCVariant.cpp b/js/xpconnect/src/XPCVariant.cpp index 9a3b456913fd4..9382c129c2ef4 100644 --- a/js/xpconnect/src/XPCVariant.cpp +++ b/js/xpconnect/src/XPCVariant.cpp @@ -153,9 +153,9 @@ class XPCArrayHomogenizer static const Type StateTable[tTypeCount][tTypeCount-1]; public: - static JSBool GetTypeForArray(JSContext* cx, HandleObject array, - uint32_t length, - nsXPTType* resultType, nsID* resultID); + static bool GetTypeForArray(JSContext* cx, HandleObject array, + uint32_t length, + nsXPTType* resultType, nsID* resultID); }; @@ -177,7 +177,7 @@ XPCArrayHomogenizer::StateTable[tTypeCount][tTypeCount-1] = { /* tUnk */{tNull,tInt ,tDbl ,tBool,tStr ,tID ,tVar ,tISup }}; // static -JSBool +bool XPCArrayHomogenizer::GetTypeForArray(JSContext* cx, HandleObject array, uint32_t length, nsXPTType* resultType, nsID* resultID) @@ -268,7 +268,7 @@ XPCArrayHomogenizer::GetTypeForArray(JSContext* cx, HandleObject array, return true; } -JSBool XPCVariant::InitializeData(JSContext* cx) +bool XPCVariant::InitializeData(JSContext* cx) { JS_CHECK_RECURSION(cx, return false); @@ -372,7 +372,7 @@ XPCVariant::GetAsJSVal(jsval* result) } // static -JSBool +bool XPCVariant::VariantDataToJS(nsIVariant* variant, nsresult* pErr, jsval* pJSVal) { diff --git a/js/xpconnect/src/XPCWrappedJS.cpp b/js/xpconnect/src/XPCWrappedJS.cpp index 935b24155c342..5b69d6df959bb 100644 --- a/js/xpconnect/src/XPCWrappedJS.cpp +++ b/js/xpconnect/src/XPCWrappedJS.cpp @@ -290,7 +290,7 @@ nsXPCWrappedJS::GetNewOrUsed(JS::HandleObject jsObj, nsXPCWrappedJS* wrapper = nullptr; nsXPCWrappedJSClass* clazz = nullptr; XPCJSRuntime* rt = nsXPConnect::GetRuntimeInstance(); - JSBool release_root = false; + bool release_root = false; map = rt->GetWrappedJSMap(); if (!map) { diff --git a/js/xpconnect/src/XPCWrappedJSClass.cpp b/js/xpconnect/src/XPCWrappedJSClass.cpp index 2f6f58bfc2e99..cdcea4cf9a36c 100644 --- a/js/xpconnect/src/XPCWrappedJSClass.cpp +++ b/js/xpconnect/src/XPCWrappedJSClass.cpp @@ -94,7 +94,7 @@ AutoScriptEvaluate::~AutoScriptEvaluate() // It turns out that some errors may be not worth reporting. So, this // function is factored out to manage that. -JSBool xpc_IsReportableErrorCode(nsresult code) +bool xpc_IsReportableErrorCode(nsresult code) { if (NS_SUCCEEDED(code)) return false; @@ -209,7 +209,7 @@ nsXPCWrappedJSClass::CallQueryInterfaceOnJSObject(JSContext* cx, JSObject* id; RootedValue retval(cx); RootedObject retObj(cx); - JSBool success = false; + bool success = false; jsid funid; RootedValue fun(cx); @@ -321,7 +321,7 @@ nsXPCWrappedJSClass::CallQueryInterfaceOnJSObject(JSContext* cx, /***************************************************************************/ -static JSBool +static bool GetNamedPropertyAsVariantRaw(XPCCallContext& ccx, JSObject* aJSObj, jsid aName, @@ -348,7 +348,7 @@ nsXPCWrappedJSClass::GetNamedPropertyAsVariant(XPCCallContext& ccx, { JSContext* cx = ccx.GetJSContext(); RootedObject aJSObj(cx, aJSObjArg); - JSBool ok; + bool ok; RootedId id(cx); nsresult rv = NS_ERROR_FAILURE; @@ -486,7 +486,7 @@ NS_DEFINE_STATIC_IID_ACCESSOR(WrappedJSIdentity, /***************************************************************************/ // static -JSBool +bool nsXPCWrappedJSClass::IsWrappedJS(nsISupports* aPtr) { void* result; @@ -823,7 +823,7 @@ xpcWrappedJSErrorReporter(JSContext *cx, const char *message, ccx.GetXPCContext()->SetException(e); } -JSBool +bool nsXPCWrappedJSClass::GetArraySizeFromParam(JSContext* cx, const XPTMethodDescriptor* method, const nsXPTParamInfo& param, @@ -854,7 +854,7 @@ nsXPCWrappedJSClass::GetArraySizeFromParam(JSContext* cx, return true; } -JSBool +bool nsXPCWrappedJSClass::GetInterfaceTypeFromParam(JSContext* cx, const XPTMethodDescriptor* method, const nsXPTParamInfo& param, @@ -962,7 +962,7 @@ nsXPCWrappedJSClass::CheckForException(XPCCallContext & ccx, nsresult pending_result = xpcc->GetPendingResult(); RootedValue js_exception(cx); - JSBool is_js_exception = JS_GetPendingException(cx, js_exception.address()); + bool is_js_exception = JS_GetPendingException(cx, js_exception.address()); /* JS might throw an expection whether the reporter was called or not */ if (is_js_exception) { @@ -1134,12 +1134,12 @@ nsXPCWrappedJSClass::CallMethod(nsXPCWrappedJS* wrapper, uint16_t methodIndex, uint8_t i; nsresult retval = NS_ERROR_FAILURE; nsresult pending_result = NS_OK; - JSBool success; - JSBool readyToDoTheCall = false; + bool success; + bool readyToDoTheCall = false; nsID param_iid; const nsXPTMethodInfo* info = static_cast(info_); const char* name = info->name; - JSBool foundDependentParam; + bool foundDependentParam; // Make sure not to set the callee on ccx until after we've gone through // the whole nsIXPCFunctionThisTranslator bit. That code uses ccx to @@ -1249,7 +1249,7 @@ nsXPCWrappedJSClass::CallMethod(nsXPCWrappedJS* wrapper, uint16_t methodIndex, if (newThis) { RootedValue v(cx); xpcObjectHelper helper(newThis); - JSBool ok = + bool ok = XPCConvert::NativeInterface2JSObject( v.address(), nullptr, helper, nullptr, nullptr, false, nullptr); diff --git a/js/xpconnect/src/XPCWrappedNative.cpp b/js/xpconnect/src/XPCWrappedNative.cpp index 3801c7396eaf6..8de894704d00d 100644 --- a/js/xpconnect/src/XPCWrappedNative.cpp +++ b/js/xpconnect/src/XPCWrappedNative.cpp @@ -504,8 +504,8 @@ XPCWrappedNative::GetNewOrUsed(xpcObjectHelper& helper, RootedObject parent(cx, Scope->GetGlobalJSObject()); RootedValue newParentVal(cx, NullValue()); - JSBool needsSOW = false; - JSBool needsCOW = false; + bool needsSOW = false; + bool needsCOW = false; mozilla::Maybe ac; @@ -991,7 +991,7 @@ XPCWrappedNative::GatherScriptableCreateInfo(nsISupports* obj, return sciProto; } -JSBool +bool XPCWrappedNative::Init(HandleObject parent, const XPCNativeScriptableCreateInfo* sci) { @@ -1052,7 +1052,7 @@ XPCWrappedNative::Init(HandleObject parent, return FinishInit(); } -JSBool +bool XPCWrappedNative::FinishInit() { AutoJSContext cx; @@ -1615,7 +1615,7 @@ XPCWrappedNative::RescueOrphans() return ::RescueOrphans(flatJSObject); } -JSBool +bool XPCWrappedNative::ExtendSet(XPCNativeInterface* aInterface) { AutoJSContext cx; @@ -1659,7 +1659,7 @@ XPCWrappedNative::LocateTearOff(XPCNativeInterface* aInterface) XPCWrappedNativeTearOff* XPCWrappedNative::FindTearOff(XPCNativeInterface* aInterface, - JSBool needJSObject /* = false */, + bool needJSObject /* = false */, nsresult* pError /* = nullptr */) { AutoJSContext cx; @@ -1683,7 +1683,7 @@ XPCWrappedNative::FindTearOff(XPCNativeInterface* aInterface, if (to->GetInterface() == aInterface) { if (needJSObject && !to->GetJSObjectPreserveColor()) { AutoMarkingWrappedNativeTearOffPtr tearoff(cx, to); - JSBool ok = InitTearOffJSObject(to); + bool ok = InitTearOffJSObject(to); // During shutdown, we don't sweep tearoffs. So make sure // to unmark manually in case the auto-marker marked us. // We shouldn't ever be getting here _during_ our @@ -1736,7 +1736,7 @@ XPCWrappedNative::FindTearOff(XPCNativeInterface* aInterface, nsresult XPCWrappedNative::InitTearOff(XPCWrappedNativeTearOff* aTearOff, XPCNativeInterface* aInterface, - JSBool needJSObject) + bool needJSObject) { AutoJSContext cx; @@ -1906,7 +1906,7 @@ XPCWrappedNative::InitTearOff(XPCWrappedNativeTearOff* aTearOff, return NS_OK; } -JSBool +bool XPCWrappedNative::InitTearOffJSObject(XPCWrappedNativeTearOff* to) { AutoJSContext cx; @@ -1971,7 +1971,7 @@ XPCWrappedNative::GetSameCompartmentSecurityWrapper(JSContext *cx) /***************************************************************************/ -static JSBool Throw(nsresult errNum, XPCCallContext& ccx) +static bool Throw(nsresult errNum, XPCCallContext& ccx) { XPCThrower::Throw(errNum, ccx); return false; @@ -1995,21 +1995,21 @@ class CallMethodHelper jsval* const mArgv; const uint32_t mArgc; - JS_ALWAYS_INLINE JSBool + JS_ALWAYS_INLINE bool GetArraySizeFromParam(uint8_t paramIndex, uint32_t* result) const; - JS_ALWAYS_INLINE JSBool + JS_ALWAYS_INLINE bool GetInterfaceTypeFromParam(uint8_t paramIndex, const nsXPTType& datum_type, nsID* result) const; - JS_ALWAYS_INLINE JSBool + JS_ALWAYS_INLINE bool GetOutParamSource(uint8_t paramIndex, MutableHandleValue srcp) const; - JS_ALWAYS_INLINE JSBool + JS_ALWAYS_INLINE bool GatherAndConvertResults(); - JS_ALWAYS_INLINE JSBool + JS_ALWAYS_INLINE bool QueryInterfaceFastPath() const; nsXPTCVariant* @@ -2027,16 +2027,16 @@ class CallMethodHelper return const_cast(this)->GetDispatchParam(paramIndex); } - JS_ALWAYS_INLINE JSBool InitializeDispatchParams(); + JS_ALWAYS_INLINE bool InitializeDispatchParams(); - JS_ALWAYS_INLINE JSBool ConvertIndependentParams(JSBool* foundDependentParam); - JS_ALWAYS_INLINE JSBool ConvertIndependentParam(uint8_t i); - JS_ALWAYS_INLINE JSBool ConvertDependentParams(); - JS_ALWAYS_INLINE JSBool ConvertDependentParam(uint8_t i); + JS_ALWAYS_INLINE bool ConvertIndependentParams(bool* foundDependentParam); + JS_ALWAYS_INLINE bool ConvertIndependentParam(uint8_t i); + JS_ALWAYS_INLINE bool ConvertDependentParams(); + JS_ALWAYS_INLINE bool ConvertDependentParam(uint8_t i); JS_ALWAYS_INLINE void CleanupParam(nsXPTCMiniVariant& param, nsXPTType& type); - JS_ALWAYS_INLINE JSBool HandleDipperParam(nsXPTCVariant* dp, + JS_ALWAYS_INLINE bool HandleDipperParam(nsXPTCVariant* dp, const nsXPTParamInfo& paramInfo); JS_ALWAYS_INLINE nsresult Invoke(); @@ -2062,12 +2062,12 @@ class CallMethodHelper ~CallMethodHelper(); - JS_ALWAYS_INLINE JSBool Call(); + JS_ALWAYS_INLINE bool Call(); }; // static -JSBool +bool XPCWrappedNative::CallMethod(XPCCallContext& ccx, CallMode mode /*= CALL_METHOD */) { @@ -2114,7 +2114,7 @@ XPCWrappedNative::CallMethod(XPCCallContext& ccx, return CallMethodHelper(ccx).Call(); } -JSBool +bool CallMethodHelper::Call() { mCallContext.SetRetVal(JSVAL_VOID); @@ -2138,7 +2138,7 @@ CallMethodHelper::Call() // When we later convert the dependent params (if any) we will know that // the params upon which they depend will have already been converted - // regardless of ordering. - JSBool foundDependentParam = false; + bool foundDependentParam = false; if (!ConvertIndependentParams(&foundDependentParam)) return false; @@ -2210,7 +2210,7 @@ CallMethodHelper::~CallMethodHelper() } -JSBool +bool CallMethodHelper::GetArraySizeFromParam(uint8_t paramIndex, uint32_t* result) const { @@ -2228,7 +2228,7 @@ CallMethodHelper::GetArraySizeFromParam(uint8_t paramIndex, return true; } -JSBool +bool CallMethodHelper::GetInterfaceTypeFromParam(uint8_t paramIndex, const nsXPTType& datum_type, nsID* result) const @@ -2259,7 +2259,7 @@ CallMethodHelper::GetInterfaceTypeFromParam(uint8_t paramIndex, return true; } -JSBool +bool CallMethodHelper::GetOutParamSource(uint8_t paramIndex, MutableHandleValue srcp) const { const nsXPTParamInfo& paramInfo = mMethodInfo->GetParam(paramIndex); @@ -2287,7 +2287,7 @@ CallMethodHelper::GetOutParamSource(uint8_t paramIndex, MutableHandleValue srcp) return true; } -JSBool +bool CallMethodHelper::GatherAndConvertResults() { // now we iterate through the native params to gather and convert results @@ -2372,7 +2372,7 @@ CallMethodHelper::GatherAndConvertResults() return true; } -JSBool +bool CallMethodHelper::QueryInterfaceFastPath() const { NS_ASSERTION(mVTableIndex == 0, @@ -2407,7 +2407,7 @@ CallMethodHelper::QueryInterfaceFastPath() const RootedValue v(mCallContext, NullValue()); nsresult err; - JSBool success = + bool success = XPCConvert::NativeData2JS(v.address(), &qiresult, nsXPTType::T_INTERFACE_IS, iid, &err); @@ -2422,7 +2422,7 @@ CallMethodHelper::QueryInterfaceFastPath() const return true; } -JSBool +bool CallMethodHelper::InitializeDispatchParams() { const uint8_t wantsOptArgc = mMethodInfo->WantsOptArgc() ? 1 : 0; @@ -2486,8 +2486,8 @@ CallMethodHelper::InitializeDispatchParams() return true; } -JSBool -CallMethodHelper::ConvertIndependentParams(JSBool* foundDependentParam) +bool +CallMethodHelper::ConvertIndependentParams(bool* foundDependentParam) { const uint8_t paramCount = mMethodInfo->GetParamCount(); for (uint8_t i = 0; i < paramCount; i++) { @@ -2503,7 +2503,7 @@ CallMethodHelper::ConvertIndependentParams(JSBool* foundDependentParam) return true; } -JSBool +bool CallMethodHelper::ConvertIndependentParam(uint8_t i) { const nsXPTParamInfo& paramInfo = mMethodInfo->GetParam(i); @@ -2581,7 +2581,7 @@ CallMethodHelper::ConvertIndependentParam(uint8_t i) return true; } -JSBool +bool CallMethodHelper::ConvertDependentParams() { const uint8_t paramCount = mMethodInfo->GetParamCount(); @@ -2597,7 +2597,7 @@ CallMethodHelper::ConvertDependentParams() return true; } -JSBool +bool CallMethodHelper::ConvertDependentParam(uint8_t i) { const nsXPTParamInfo& paramInfo = mMethodInfo->GetParam(i); @@ -2764,7 +2764,7 @@ CallMethodHelper::CleanupParam(nsXPTCMiniVariant& param, nsXPTType& type) // after the call. // // This method creates these empty containers. -JSBool +bool CallMethodHelper::HandleDipperParam(nsXPTCVariant* dp, const nsXPTParamInfo& paramInfo) { @@ -3148,7 +3148,7 @@ static void ReportSingleMember(jsval ifaceName, } } -static void ShowHeader(JSBool* printedHeader, +static void ShowHeader(bool* printedHeader, const char* header, XPCNativeSet* set, XPCWrappedNative* wrapper, @@ -3179,8 +3179,8 @@ static void ShowDuplicateInterface(jsval ifaceName) fputs(" appears twice in the nsIClassInfo interface set!\n", stdout); } -static JSBool InterfacesAreRelated(XPCNativeInterface* iface1, - XPCNativeInterface* iface2) +static bool InterfacesAreRelated(XPCNativeInterface* iface1, + XPCNativeInterface* iface2) { nsIInterfaceInfo* info1 = iface1->GetInterfaceInfo(); nsIInterfaceInfo* info2 = iface2->GetInterfaceInfo(); @@ -3194,10 +3194,10 @@ static JSBool InterfacesAreRelated(XPCNativeInterface* iface1, (NS_SUCCEEDED(info2->HasAncestor(iface1->GetIID(), &match)) && match); } -static JSBool MembersAreTheSame(XPCNativeInterface* iface1, - uint16_t memberIndex1, - XPCNativeInterface* iface2, - uint16_t memberIndex2) +static bool MembersAreTheSame(XPCNativeInterface* iface1, + uint16_t memberIndex1, + XPCNativeInterface* iface2, + uint16_t memberIndex2) { nsIInterfaceInfo* info1 = iface1->GetInterfaceInfo(); nsIInterfaceInfo* info2 = iface2->GetInterfaceInfo(); @@ -3313,7 +3313,7 @@ void DEBUG_ReportShadowedMembers(XPCNativeSet* set, const char header[] = "!!!Object wrapped by XPConnect has members whose names shadow each other!!!"; - JSBool printedHeader = false; + bool printedHeader = false; jsval QIName = rt->GetStringJSVal(XPCJSRuntime::IDX_QUERY_INTERFACE); diff --git a/js/xpconnect/src/XPCWrappedNativeInfo.cpp b/js/xpconnect/src/XPCWrappedNativeInfo.cpp index 8d51952d1b3ea..98f230e6ee0be 100644 --- a/js/xpconnect/src/XPCWrappedNativeInfo.cpp +++ b/js/xpconnect/src/XPCWrappedNativeInfo.cpp @@ -20,7 +20,7 @@ using namespace mozilla; // XPCNativeMember // static -JSBool +bool XPCNativeMember::GetCallInfo(JSObject* funobj, XPCNativeInterface** pInterface, XPCNativeMember** pMember) @@ -35,7 +35,7 @@ XPCNativeMember::GetCallInfo(JSObject* funobj, return true; } -JSBool +bool XPCNativeMember::NewFunctionObject(XPCCallContext& ccx, XPCNativeInterface* iface, HandleObject parent, jsval* pval) @@ -46,7 +46,7 @@ XPCNativeMember::NewFunctionObject(XPCCallContext& ccx, return Resolve(ccx, iface, parent, pval); } -JSBool +bool XPCNativeMember::Resolve(XPCCallContext& ccx, XPCNativeInterface* iface, HandleObject parent, jsval *vp) { @@ -233,7 +233,7 @@ XPCNativeInterface::NewInstance(nsIInterfaceInfo* aInfo) XPCNativeMember* members = nullptr; int i; - JSBool failed = false; + bool failed = false; uint16_t constCount; uint16_t methodCount; uint16_t totalCount; diff --git a/js/xpconnect/src/XPCWrappedNativeJSOps.cpp b/js/xpconnect/src/XPCWrappedNativeJSOps.cpp index 98b8e3d744ee3..175e3e4d75aa0 100644 --- a/js/xpconnect/src/XPCWrappedNativeJSOps.cpp +++ b/js/xpconnect/src/XPCWrappedNativeJSOps.cpp @@ -22,7 +22,7 @@ using namespace JS; // All of the exceptions thrown into JS from this file go through here. // That makes this a nice place to set a breakpoint. -static JSBool Throw(nsresult errNum, JSContext* cx) +static bool Throw(nsresult errNum, JSContext* cx) { XPCThrower::Throw(errNum, cx); return false; @@ -40,7 +40,7 @@ static JSBool Throw(nsresult errNum, JSContext* cx) /***************************************************************************/ -static JSBool +static bool ToStringGuts(XPCCallContext& ccx) { char* sz; @@ -194,7 +194,7 @@ XPC_WN_DoubleWrappedGetter(JSContext *cx, unsigned argc, jsval *vp) * We *never* set toString or toSource as JS_ENUMERATE. */ -static JSBool +static bool DefinePropertyIfFound(XPCCallContext& ccx, HandleObject obj, HandleId idArg, @@ -202,16 +202,16 @@ DefinePropertyIfFound(XPCCallContext& ccx, XPCNativeInterface* iface, XPCNativeMember* member, XPCWrappedNativeScope* scope, - JSBool reflectToStringAndToSource, + bool reflectToStringAndToSource, XPCWrappedNative* wrapperToReflectInterfaceNames, XPCWrappedNative* wrapperToReflectDoubleWrap, XPCNativeScriptableInfo* scriptableInfo, unsigned propFlags, - JSBool* resolved) + bool* resolved) { RootedId id(ccx, idArg); XPCJSRuntime* rt = ccx.GetRuntime(); - JSBool found; + bool found; const char* name; if (set) { @@ -429,7 +429,7 @@ DefinePropertyIfFound(XPCCallContext& ccx, /***************************************************************************/ /***************************************************************************/ -static JSBool +static bool XPC_WN_OnlyIWrite_AddPropertyStub(JSContext *cx, HandleObject obj, HandleId id, MutableHandleValue vp) { XPCCallContext ccx(JS_CALLER, cx, obj, NullPtr(), id); @@ -443,35 +443,35 @@ XPC_WN_OnlyIWrite_AddPropertyStub(JSContext *cx, HandleObject obj, HandleId id, return Throw(NS_ERROR_XPC_CANT_MODIFY_PROP_ON_WN, cx); } -static JSBool -XPC_WN_OnlyIWrite_SetPropertyStub(JSContext *cx, HandleObject obj, HandleId id, JSBool strict, +static bool +XPC_WN_OnlyIWrite_SetPropertyStub(JSContext *cx, HandleObject obj, HandleId id, bool strict, MutableHandleValue vp) { return XPC_WN_OnlyIWrite_AddPropertyStub(cx, obj, id, vp); } -static JSBool +static bool XPC_WN_CannotModifyPropertyStub(JSContext *cx, HandleObject obj, HandleId id, MutableHandleValue vp) { return Throw(NS_ERROR_XPC_CANT_MODIFY_PROP_ON_WN, cx); } -static JSBool +static bool XPC_WN_CantDeletePropertyStub(JSContext *cx, HandleObject obj, HandleId id, - JSBool *succeeded) + bool *succeeded) { return Throw(NS_ERROR_XPC_CANT_MODIFY_PROP_ON_WN, cx); } -static JSBool -XPC_WN_CannotModifyStrictPropertyStub(JSContext *cx, HandleObject obj, HandleId id, JSBool strict, +static bool +XPC_WN_CannotModifyStrictPropertyStub(JSContext *cx, HandleObject obj, HandleId id, bool strict, MutableHandleValue vp) { return XPC_WN_CannotModifyPropertyStub(cx, obj, id, vp); } -static JSBool +static bool XPC_WN_Shared_Convert(JSContext *cx, HandleObject obj, JSType type, MutableHandleValue vp) { if (type == JSTYPE_OBJECT) { @@ -528,7 +528,7 @@ XPC_WN_Shared_Convert(JSContext *cx, HandleObject obj, JSType type, MutableHandl return false; } -static JSBool +static bool XPC_WN_Shared_Enumerate(JSContext *cx, HandleObject obj) { XPCCallContext ccx(JS_CALLER, cx, obj); @@ -623,7 +623,7 @@ XPC_WN_NoHelper_Trace(JSTracer *trc, JSObject *obj) MarkWrappedNative(trc, obj); } -static JSBool +static bool XPC_WN_NoHelper_Resolve(JSContext *cx, HandleObject obj, HandleId id) { XPCCallContext ccx(JS_CALLER, cx, obj, NullPtr(), id); @@ -754,7 +754,7 @@ XPCWrappedNativeJSClass XPC_WN_NoHelper_JSClass = { /***************************************************************************/ -static JSBool +static bool XPC_WN_MaybeResolvingPropertyStub(JSContext *cx, HandleObject obj, HandleId id, MutableHandleValue vp) { XPCCallContext ccx(JS_CALLER, cx, obj); @@ -766,15 +766,15 @@ XPC_WN_MaybeResolvingPropertyStub(JSContext *cx, HandleObject obj, HandleId id, return Throw(NS_ERROR_XPC_CANT_MODIFY_PROP_ON_WN, cx); } -static JSBool -XPC_WN_MaybeResolvingStrictPropertyStub(JSContext *cx, HandleObject obj, HandleId id, JSBool strict, +static bool +XPC_WN_MaybeResolvingStrictPropertyStub(JSContext *cx, HandleObject obj, HandleId id, bool strict, MutableHandleValue vp) { return XPC_WN_MaybeResolvingPropertyStub(cx, obj, id, vp); } -static JSBool -XPC_WN_MaybeResolvingDeletePropertyStub(JSContext *cx, HandleObject obj, HandleId id, JSBool *succeeded) +static bool +XPC_WN_MaybeResolvingDeletePropertyStub(JSContext *cx, HandleObject obj, HandleId id, bool *succeeded) { XPCCallContext ccx(JS_CALLER, cx, obj); XPCWrappedNative* wrapper = ccx.GetWrapper(); @@ -807,7 +807,7 @@ XPC_WN_MaybeResolvingDeletePropertyStub(JSContext *cx, HandleObject obj, HandleI return Throw(rv, cx); \ return retval; -static JSBool +static bool XPC_WN_Helper_AddProperty(JSContext *cx, HandleObject obj, HandleId id, MutableHandleValue vp) { @@ -816,16 +816,16 @@ XPC_WN_Helper_AddProperty(JSContext *cx, HandleObject obj, HandleId id, POST_HELPER_STUB } -static JSBool +static bool XPC_WN_Helper_DelProperty(JSContext *cx, HandleObject obj, HandleId id, - JSBool *succeeded) + bool *succeeded) { PRE_HELPER_STUB DelProperty(wrapper, cx, obj, id, &retval); POST_HELPER_STUB } -JSBool +bool XPC_WN_Helper_GetProperty(JSContext *cx, HandleObject obj, HandleId id, MutableHandleValue vp) { @@ -834,8 +834,8 @@ XPC_WN_Helper_GetProperty(JSContext *cx, HandleObject obj, HandleId id, POST_HELPER_STUB } -JSBool -XPC_WN_Helper_SetProperty(JSContext *cx, HandleObject obj, HandleId id, JSBool strict, +bool +XPC_WN_Helper_SetProperty(JSContext *cx, HandleObject obj, HandleId id, bool strict, MutableHandleValue vp) { PRE_HELPER_STUB @@ -843,7 +843,7 @@ XPC_WN_Helper_SetProperty(JSContext *cx, HandleObject obj, HandleId id, JSBool s POST_HELPER_STUB } -static JSBool +static bool XPC_WN_Helper_Convert(JSContext *cx, HandleObject obj, JSType type, MutableHandleValue vp) { PRE_HELPER_STUB @@ -851,7 +851,7 @@ XPC_WN_Helper_Convert(JSContext *cx, HandleObject obj, JSType type, MutableHandl POST_HELPER_STUB } -static JSBool +static bool XPC_WN_Helper_CheckAccess(JSContext *cx, HandleObject obj, HandleId id, JSAccessMode mode, MutableHandleValue vp) { @@ -899,8 +899,8 @@ XPC_WN_Helper_Construct(JSContext *cx, unsigned argc, jsval *vp) POST_HELPER_STUB } -static JSBool -XPC_WN_Helper_HasInstance(JSContext *cx, HandleObject obj, MutableHandleValue valp, JSBool *bp) +static bool +XPC_WN_Helper_HasInstance(JSContext *cx, HandleObject obj, MutableHandleValue valp, bool *bp) { bool retval2; PRE_HELPER_STUB @@ -915,7 +915,7 @@ XPC_WN_Helper_Finalize(js::FreeOp *fop, JSObject *obj) WrappedNativeFinalize(fop, obj, WN_HELPER); } -static JSBool +static bool XPC_WN_Helper_NewResolve(JSContext *cx, HandleObject obj, HandleId id, unsigned flags, MutableHandleObject objp) { @@ -931,7 +931,7 @@ XPC_WN_Helper_NewResolve(JSContext *cx, HandleObject obj, HandleId id, unsigned XPCNativeScriptableInfo* si = wrapper->GetScriptableInfo(); if (si && si->GetFlags().WantNewResolve()) { XPCWrappedNative* oldResolvingWrapper; - JSBool allowPropMods = si->GetFlags().AllowPropModsDuringResolve(); + bool allowPropMods = si->GetFlags().AllowPropModsDuringResolve(); if (allowPropMods) oldResolvingWrapper = ccx.SetResolvingWrapper(wrapper); @@ -961,7 +961,7 @@ XPC_WN_Helper_NewResolve(JSContext *cx, HandleObject obj, HandleId id, unsigned wrapper->GetProto()->GetSet() : nullptr; XPCNativeMember* member; XPCNativeInterface* iface; - JSBool IsLocal; + bool IsLocal; if (set->FindMember(id, &member, &iface, protoSet, &IsLocal) && IsLocal) { @@ -977,7 +977,7 @@ XPC_WN_Helper_NewResolve(JSContext *cx, HandleObject obj, HandleId id, unsigned XPCWrappedNative* wrapperForInterfaceNames = siFlags.DontReflectInterfaceNames() ? nullptr : wrapper; - JSBool resolved; + bool resolved; oldResolvingWrapper = ccx.SetResolvingWrapper(wrapper); retval = DefinePropertyIfFound(ccx, obj, id, set, iface, member, @@ -1032,7 +1032,7 @@ XPC_WN_Helper_NewResolve(JSContext *cx, HandleObject obj, HandleId id, unsigned do shared enumerate - don't use this JSOp thing at all */ -JSBool +bool XPC_WN_JSOp_Enumerate(JSContext *cx, HandleObject obj, JSIterateOp enum_op, MutableHandleValue statep, MutableHandleId idp) { @@ -1136,7 +1136,7 @@ XPCNativeScriptableInfo::Construct(const XPCNativeScriptableCreateInfo* sci) return nullptr; } - JSBool success; + bool success; XPCJSRuntime* rt = XPCJSRuntime::Get(); XPCNativeScriptableSharedMap* map = rt->GetNativeScriptableSharedMap(); @@ -1339,7 +1339,7 @@ XPC_WN_GetterSetter(JSContext *cx, unsigned argc, jsval *vp) if (argc && member->IsWritableAttribute()) { ccx.SetCallInfo(iface, member, true); - JSBool retval = XPCWrappedNative::SetAttribute(ccx); + bool retval = XPCWrappedNative::SetAttribute(ccx); if (retval) *vp = JS_ARGV(cx, vp)[0]; return retval; @@ -1352,7 +1352,7 @@ XPC_WN_GetterSetter(JSContext *cx, unsigned argc, jsval *vp) /***************************************************************************/ -static JSBool +static bool XPC_WN_Shared_Proto_Enumerate(JSContext *cx, HandleObject obj) { NS_ASSERTION(js::GetObjectClass(obj) == &XPC_WN_ModsAllowed_WithCall_Proto_JSClass || @@ -1413,7 +1413,7 @@ XPC_WN_Shared_Proto_Trace(JSTracer *trc, JSObject *obj) /*****************************************************/ -static JSBool +static bool XPC_WN_ModsAllowed_Proto_Resolve(JSContext *cx, HandleObject obj, HandleId id) { NS_ASSERTION(js::GetObjectClass(obj) == &XPC_WN_ModsAllowed_WithCall_Proto_JSClass || @@ -1492,7 +1492,7 @@ js::Class XPC_WN_ModsAllowed_NoCall_Proto_JSClass = { /***************************************************************************/ -static JSBool +static bool XPC_WN_OnlyIWrite_Proto_AddPropertyStub(JSContext *cx, HandleObject obj, HandleId id, MutableHandleValue vp) { @@ -1516,14 +1516,14 @@ XPC_WN_OnlyIWrite_Proto_AddPropertyStub(JSContext *cx, HandleObject obj, HandleI return Throw(NS_ERROR_XPC_BAD_OP_ON_WN_PROTO, cx); } -static JSBool -XPC_WN_OnlyIWrite_Proto_SetPropertyStub(JSContext *cx, HandleObject obj, HandleId id, JSBool strict, +static bool +XPC_WN_OnlyIWrite_Proto_SetPropertyStub(JSContext *cx, HandleObject obj, HandleId id, bool strict, MutableHandleValue vp) { return XPC_WN_OnlyIWrite_Proto_AddPropertyStub(cx, obj, id, vp); } -static JSBool +static bool XPC_WN_NoMods_Proto_Resolve(JSContext *cx, HandleObject obj, HandleId id) { NS_ASSERTION(js::GetObjectClass(obj) == &XPC_WN_NoMods_WithCall_Proto_JSClass || @@ -1604,7 +1604,7 @@ js::Class XPC_WN_NoMods_NoCall_Proto_JSClass = { /***************************************************************************/ -static JSBool +static bool XPC_WN_TearOff_Enumerate(JSContext *cx, HandleObject obj) { XPCCallContext ccx(JS_CALLER, cx, obj); @@ -1626,7 +1626,7 @@ XPC_WN_TearOff_Enumerate(JSContext *cx, HandleObject obj) return true; } -static JSBool +static bool XPC_WN_TearOff_Resolve(JSContext *cx, HandleObject obj, HandleId id) { XPCCallContext ccx(JS_CALLER, cx, obj); diff --git a/js/xpconnect/src/XPCWrappedNativeProto.cpp b/js/xpconnect/src/XPCWrappedNativeProto.cpp index bb89b148bcc67..f161e134093c5 100644 --- a/js/xpconnect/src/XPCWrappedNativeProto.cpp +++ b/js/xpconnect/src/XPCWrappedNativeProto.cpp @@ -56,7 +56,7 @@ XPCWrappedNativeProto::~XPCWrappedNativeProto() delete mScriptableInfo; } -JSBool +bool XPCWrappedNativeProto::Init(const XPCNativeScriptableCreateInfo* scriptableCreateInfo, bool callPostCreatePrototype) { @@ -190,7 +190,7 @@ XPCWrappedNativeProto::GetNewOrUsed(XPCWrappedNativeScope* scope, if (NS_FAILED(classInfo->GetFlags(&ciFlags))) ciFlags = 0; - JSBool mainThreadOnly = !!(ciFlags & nsIClassInfo::MAIN_THREAD_ONLY); + bool mainThreadOnly = !!(ciFlags & nsIClassInfo::MAIN_THREAD_ONLY); map = scope->GetWrappedNativeProtoMap(mainThreadOnly); lock = mainThreadOnly ? nullptr : scope->GetRuntime()->GetMapLock(); { // scoped lock diff --git a/js/xpconnect/src/XPCWrappedNativeScope.cpp b/js/xpconnect/src/XPCWrappedNativeScope.cpp index e89f4a0154615..3f0125b31733a 100644 --- a/js/xpconnect/src/XPCWrappedNativeScope.cpp +++ b/js/xpconnect/src/XPCWrappedNativeScope.cpp @@ -177,7 +177,7 @@ XPCWrappedNativeScope::XPCWrappedNativeScope(JSContext *cx, } // static -JSBool +bool XPCWrappedNativeScope::IsDyingScope(XPCWrappedNativeScope *scope) { for (XPCWrappedNativeScope *cur = gDyingScopes; cur; cur = cur->mNext) { diff --git a/js/xpconnect/src/XPCWrapper.cpp b/js/xpconnect/src/XPCWrapper.cpp index 309c7807d3628..077ea6f9b21a8 100644 --- a/js/xpconnect/src/XPCWrapper.cpp +++ b/js/xpconnect/src/XPCWrapper.cpp @@ -17,7 +17,7 @@ using namespace mozilla; namespace XPCNativeWrapper { static inline -JSBool +bool ThrowException(nsresult ex, JSContext *cx) { XPCThrower::Throw(ex, cx); diff --git a/js/xpconnect/src/XPCWrapper.h b/js/xpconnect/src/XPCWrapper.h index 712032418a061..49a8ff4eafd41 100644 --- a/js/xpconnect/src/XPCWrapper.h +++ b/js/xpconnect/src/XPCWrapper.h @@ -43,7 +43,7 @@ GetSecurityManager() return nsXPConnect::gScriptSecurityManager; } -inline JSBool +inline bool IsSecurityWrapper(JSObject *wrapper) { return js::IsWrapper(wrapper); diff --git a/js/xpconnect/src/dictionary_helper_gen.py b/js/xpconnect/src/dictionary_helper_gen.py index 568d2b044d3fa..50d85bab67846 100644 --- a/js/xpconnect/src/dictionary_helper_gen.py +++ b/js/xpconnect/src/dictionary_helper_gen.py @@ -284,7 +284,7 @@ def write_getter(a, iface, fd): if realtype.count("JS::Value"): fd.write(" aDict.%s = v;\n" % a.name) elif realtype.count("bool"): - fd.write(" JSBool b;\n") + fd.write(" bool b;\n") fd.write(" MOZ_ALWAYS_TRUE(JS_ValueToBoolean(aCx, v, &b));\n") fd.write(" aDict.%s = b;\n" % a.name) elif realtype.count("uint16_t"): @@ -370,7 +370,7 @@ def write_cpp(iface, fd): iface.base) fd.write(" NS_ENSURE_SUCCESS(rv, rv);\n") - fd.write(" JSBool found = false;\n") + fd.write(" bool found = false;\n") needccx = False for a in attributes: if a.realtype.nativeType('in').count("nsIVariant"): diff --git a/js/xpconnect/src/nsDOMQS.h b/js/xpconnect/src/nsDOMQS.h index 53ef1c62e47cc..fef6df3d4543b 100644 --- a/js/xpconnect/src/nsDOMQS.h +++ b/js/xpconnect/src/nsDOMQS.h @@ -62,7 +62,7 @@ NEW_BINDING(nsDOMUIEvent, UIEvent); #define DEFINE_UNWRAP_CAST(_interface, _base, _bit) \ template <> \ -MOZ_ALWAYS_INLINE JSBool \ +MOZ_ALWAYS_INLINE bool \ xpc_qsUnwrapThis<_interface>(JSContext *cx, \ JS::HandleObject obj, \ _interface **ppThis, \ diff --git a/js/xpconnect/src/nsXPConnect.cpp b/js/xpconnect/src/nsXPConnect.cpp index a5bd738542067..1aabc721d0e07 100644 --- a/js/xpconnect/src/nsXPConnect.cpp +++ b/js/xpconnect/src/nsXPConnect.cpp @@ -67,11 +67,11 @@ NS_IMPL_ISUPPORTS5(nsXPConnect, nsIJSEngineTelemetryStats) nsXPConnect* nsXPConnect::gSelf = nullptr; -JSBool nsXPConnect::gOnceAliveNowDead = false; +bool nsXPConnect::gOnceAliveNowDead = false; uint32_t nsXPConnect::gReportAllJSExceptions = 0; -JSBool xpc::gDebugMode = false; -JSBool xpc::gDesiredDebugMode = false; +bool xpc::gDebugMode = false; +bool xpc::gDesiredDebugMode = false; // Global cache of the default script security manager (QI'd to // nsIScriptSecurityManager) @@ -218,7 +218,7 @@ nsXPConnect::GetRuntimeInstance() } // static -JSBool +bool nsXPConnect::IsISupportsDescendant(nsIInterfaceInfo* info) { bool found = false; @@ -310,7 +310,7 @@ nsXPConnect::GarbageCollect(uint32_t reason) return NS_OK; } -JSBool +bool xpc_GCThingIsGrayCCThing(void *thing) { return AddToCCKind(js::GCThingTraceKind(thing)) && diff --git a/js/xpconnect/src/qsgen.py b/js/xpconnect/src/qsgen.py index 97a0ef78973c5..b31b6ccacd391 100644 --- a/js/xpconnect/src/qsgen.py +++ b/js/xpconnect/src/qsgen.py @@ -327,7 +327,7 @@ def writeHeaderFile(filename, name): f.write("/* THIS FILE IS AUTOGENERATED - DO NOT EDIT */\n" "#ifndef " + headerMacro + "\n" "#define " + headerMacro + "\n\n" - "JSBool " + name + "_DefineQuickStubs(" + "bool " + name + "_DefineQuickStubs(" "JSContext *cx, JSObject *proto, unsigned flags, " "uint32_t count, const nsID **iids);\n\n" "void " + name + "_MarkInterfaces();\n\n" @@ -433,7 +433,7 @@ def replacement(match): " return false;\n", 'boolean': - " JSBool ${name};\n" + " bool ${name};\n" " JS_ValueToBoolean(cx, ${argVal}, &${name});\n", '[astring]': diff --git a/js/xpconnect/src/xpcprivate.h b/js/xpconnect/src/xpcprivate.h index 582bbd4050a12..c59d982270dd5 100644 --- a/js/xpconnect/src/xpcprivate.h +++ b/js/xpconnect/src/xpcprivate.h @@ -463,7 +463,7 @@ class nsXPConnect : public nsIXPConnect, static XPCJSRuntime* GetRuntimeInstance(); XPCJSRuntime* GetRuntime() {return mRuntime;} - static JSBool IsISupportsDescendant(nsIInterfaceInfo* info); + static bool IsISupportsDescendant(nsIInterfaceInfo* info); nsIXPCSecurityManager* GetDefaultSecurityManager() const { @@ -486,7 +486,7 @@ class nsXPConnect : public nsIXPConnect, virtual ~nsXPConnect(); - JSBool IsShuttingDown() const {return mShuttingDown;} + bool IsShuttingDown() const {return mShuttingDown;} nsresult GetInfoForIID(const nsIID * aIID, nsIInterfaceInfo** info); nsresult GetInfoForName(const char * name, nsIInterfaceInfo** info); @@ -516,18 +516,18 @@ class nsXPConnect : public nsIXPConnect, private: // Singleton instance static nsXPConnect* gSelf; - static JSBool gOnceAliveNowDead; + static bool gOnceAliveNowDead; XPCJSRuntime* mRuntime; nsIXPCSecurityManager* mDefaultSecurityManager; - JSBool mShuttingDown; + bool mShuttingDown; // nsIThreadInternal doesn't remember which observers it called // OnProcessNextEvent on when it gets around to calling AfterProcessNextEvent. // So if XPConnect gets initialized mid-event (which can happen), we'll get // an 'after' notification without getting an 'on' notification. If we don't // watch out for this, we'll do an unmatched |pop| on the context stack. - uint16_t mEventDepth; + uint16_t mEventDepth; static uint32_t gReportAllJSExceptions; @@ -579,7 +579,7 @@ class XPCReadableJSStringWrapper : public nsDependentString nsDependentString(char_traits::sEmptyBuffer, char_traits::sEmptyBuffer) { SetIsVoid(true); } - JSBool init(JSContext* aContext, JSString* str) + bool init(JSContext* aContext, JSString* str) { size_t length; const jschar* chars = JS_GetStringCharsZAndLength(aContext, str, &length); @@ -666,7 +666,7 @@ class XPCJSRuntime : public mozilla::CycleCollectedJSRuntime XPCLock* GetMapLock() const {return mMapLock;} - JSBool OnJSContextNew(JSContext* cx); + bool OnJSContextNew(JSContext* cx); virtual bool DescribeCustomObjects(JSObject* aObject, js::Class* aClasp, @@ -682,7 +682,7 @@ class XPCJSRuntime : public mozilla::CycleCollectedJSRuntime */ public: - JSBool GetDoingFinalization() const {return mDoingFinalization;} + bool GetDoingFinalization() const {return mDoingFinalization;} // Mapping of often used strings to jsid atoms that live 'forever'. // @@ -738,7 +738,7 @@ class XPCJSRuntime : public mozilla::CycleCollectedJSRuntime static void GCSliceCallback(JSRuntime *rt, JS::GCProgress progress, const JS::GCDescription &desc); - static void FinalizeCallback(JSFreeOp *fop, JSFinalizeStatus status, JSBool isCompartmentGC); + static void FinalizeCallback(JSFreeOp *fop, JSFinalizeStatus status, bool isCompartmentGC); inline void AddVariantRoot(XPCTraceableVariant* variant); inline void AddWrappedJSRoot(nsXPCWrappedJS* wrappedJS); @@ -824,7 +824,7 @@ class XPCJSRuntime : public mozilla::CycleCollectedJSRuntime void AddContextCallback(xpcContextCallback cb); void RemoveContextCallback(xpcContextCallback cb); - static void ActivityCallback(void *arg, JSBool active); + static void ActivityCallback(void *arg, bool active); static void CTypesActivityCallback(JSContext *cx, js::CTypesActivityType type); @@ -865,7 +865,7 @@ class XPCJSRuntime : public mozilla::CycleCollectedJSRuntime PRThread* mThreadRunningGC; nsTArray mWrappedJSToReleaseArray; nsTArray mNativesToReleaseArray; - JSBool mDoingFinalization; + bool mDoingFinalization; XPCRootSetElem *mVariantRoots; XPCRootSetElem *mWrappedJSRoots; XPCRootSetElem *mObjectHolderRoots; @@ -933,15 +933,15 @@ class XPCContext mCallingLangType = lt; return tmp; } - JSBool CallerTypeIsJavaScript() const + bool CallerTypeIsJavaScript() const { return LANG_JS == mCallingLangType; } - JSBool CallerTypeIsNative() const + bool CallerTypeIsNative() const { return LANG_NATIVE == mCallingLangType; } - JSBool CallerTypeIsKnown() const + bool CallerTypeIsKnown() const { return LANG_UNKNOWN != mCallingLangType; } @@ -1043,12 +1043,12 @@ class MOZ_STACK_CLASS XPCCallContext : public nsAXPCNativeCallContext virtual ~XPCCallContext(); - inline JSBool IsValid() const ; + inline bool IsValid() const ; inline XPCJSRuntime* GetRuntime() const ; inline XPCContext* GetXPCContext() const ; inline JSContext* GetJSContext() const ; - inline JSBool GetContextPopRequired() const ; + inline bool GetContextPopRequired() const ; inline XPCContext::LangType GetCallerLanguage() const ; inline XPCContext::LangType GetPrevCallerLanguage() const ; inline XPCCallContext* GetPrevCallContext() const ; @@ -1058,19 +1058,19 @@ class MOZ_STACK_CLASS XPCCallContext : public nsAXPCNativeCallContext inline XPCWrappedNative* GetWrapper() const ; inline XPCWrappedNativeProto* GetProto() const ; - inline JSBool CanGetTearOff() const ; + inline bool CanGetTearOff() const ; inline XPCWrappedNativeTearOff* GetTearOff() const ; inline XPCNativeScriptableInfo* GetScriptableInfo() const ; - inline JSBool CanGetSet() const ; + inline bool CanGetSet() const ; inline XPCNativeSet* GetSet() const ; - inline JSBool CanGetInterface() const ; + inline bool CanGetInterface() const ; inline XPCNativeInterface* GetInterface() const ; inline XPCNativeMember* GetMember() const ; - inline JSBool HasInterfaceAndMember() const ; + inline bool HasInterfaceAndMember() const ; inline jsid GetName() const ; - inline JSBool GetStaticMemberIsLocal() const ; - inline unsigned GetArgc() const ; + inline bool GetStaticMemberIsLocal() const ; + inline unsigned GetArgc() const ; inline jsval* GetArgv() const ; inline jsval* GetRetVal() const ; @@ -1088,7 +1088,7 @@ class MOZ_STACK_CLASS XPCCallContext : public nsAXPCNativeCallContext void SetName(jsid name); void SetArgsAndResultPtr(unsigned argc, jsval *argv, jsval *rval); void SetCallInfo(XPCNativeInterface* iface, XPCNativeMember* member, - JSBool isSetter); + bool isSetter); nsresult CanCallNow(); @@ -1152,7 +1152,7 @@ inline void CHECK_STATE(int s) const {NS_ASSERTION(mState >= s, "bad state");} XPCNativeMember* mMember; JS::RootedId mName; - JSBool mStaticMemberIsLocal; + bool mStaticMemberIsLocal; unsigned mArgc; jsval* mArgv; @@ -1187,7 +1187,7 @@ XPC_WN_CallMethod(JSContext *cx, unsigned argc, jsval *vp); extern bool XPC_WN_GetterSetter(JSContext *cx, unsigned argc, jsval *vp); -extern JSBool +extern bool XPC_WN_JSOp_Enumerate(JSContext *cx, JS::HandleObject obj, JSIterateOp enum_op, JS::MutableHandleValue statep, JS::MutableHandleId idp); @@ -1311,7 +1311,7 @@ class XPCWrappedNativeScope : public PRCList GetWrappedNativeMap() const {return mWrappedNativeMap;} ClassInfo2WrappedNativeProtoMap* - GetWrappedNativeProtoMap(JSBool aMainThreadOnly) const + GetWrappedNativeProtoMap(bool aMainThreadOnly) const {return aMainThreadOnly ? mMainThreadWrappedNativeProtoMap : mWrappedNativeProtoMap;} @@ -1386,10 +1386,10 @@ class XPCWrappedNativeScope : public PRCList size_t SizeOfIncludingThis(mozilla::MallocSizeOf mallocSizeOf); - JSBool + bool IsValid() const {return mRuntime != nullptr;} - static JSBool + static bool IsDyingScope(XPCWrappedNativeScope *scope); static void InitStatics() { gScopes = nullptr; gDyingScopes = nullptr; } @@ -1488,36 +1488,36 @@ class XPCWrappedNativeScope : public PRCList class XPCNativeMember { public: - static JSBool GetCallInfo(JSObject* funobj, - XPCNativeInterface** pInterface, - XPCNativeMember** pMember); + static bool GetCallInfo(JSObject* funobj, + XPCNativeInterface** pInterface, + XPCNativeMember** pMember); jsid GetName() const {return mName;} uint16_t GetIndex() const {return mIndex;} - JSBool GetConstantValue(XPCCallContext& ccx, XPCNativeInterface* iface, - jsval* pval) + bool GetConstantValue(XPCCallContext& ccx, XPCNativeInterface* iface, + jsval* pval) {NS_ASSERTION(IsConstant(), "Only call this if you're sure this is a constant!"); return Resolve(ccx, iface, JS::NullPtr(), pval);} - JSBool NewFunctionObject(XPCCallContext& ccx, XPCNativeInterface* iface, - JS::HandleObject parent, jsval* pval); + bool NewFunctionObject(XPCCallContext& ccx, XPCNativeInterface* iface, + JS::HandleObject parent, jsval* pval); - JSBool IsMethod() const + bool IsMethod() const {return 0 != (mFlags & METHOD);} - JSBool IsConstant() const + bool IsConstant() const {return 0 != (mFlags & CONSTANT);} - JSBool IsAttribute() const + bool IsAttribute() const {return 0 != (mFlags & GETTER);} - JSBool IsWritableAttribute() const + bool IsWritableAttribute() const {return 0 != (mFlags & SETTER_TOO);} - JSBool IsReadOnlyAttribute() const + bool IsReadOnlyAttribute() const {return IsAttribute() && !IsWritableAttribute();} @@ -1540,8 +1540,8 @@ class XPCNativeMember ~XPCNativeMember() {MOZ_COUNT_DTOR(XPCNativeMember);} private: - JSBool Resolve(XPCCallContext& ccx, XPCNativeInterface* iface, - JS::HandleObject parent, jsval *vp); + bool Resolve(XPCCallContext& ccx, XPCNativeInterface* iface, + JS::HandleObject parent, jsval *vp); enum { METHOD = 0x01, @@ -1578,7 +1578,7 @@ class XPCNativeInterface inline const char* GetNameString() const; inline XPCNativeMember* FindMember(jsid name) const; - inline JSBool HasAncestor(const nsIID* iid) const; + inline bool HasAncestor(const nsIID* iid) const; uint16_t GetMemberCount() const { return mMemberCount; @@ -1675,7 +1675,7 @@ class XPCNativeSetKey // virtual methods and their first data member is a uint16_t. We are // confident that XPCNativeSet->mMemberCount will never be 0xffff. - JSBool IsAKey() const {return mIsAKey == IS_A_KEY;} + bool IsAKey() const {return mIsAKey == IS_A_KEY;} enum {IS_A_KEY = 0xffff}; @@ -1713,21 +1713,21 @@ class XPCNativeSet static void ClearCacheEntryForClassInfo(nsIClassInfo* classInfo); - inline JSBool FindMember(jsid name, XPCNativeMember** pMember, + inline bool FindMember(jsid name, XPCNativeMember** pMember, uint16_t* pInterfaceIndex) const; - inline JSBool FindMember(jsid name, XPCNativeMember** pMember, + inline bool FindMember(jsid name, XPCNativeMember** pMember, XPCNativeInterface** pInterface) const; - inline JSBool FindMember(jsid name, + inline bool FindMember(jsid name, XPCNativeMember** pMember, XPCNativeInterface** pInterface, XPCNativeSet* protoSet, - JSBool* pIsLocal) const; + bool* pIsLocal) const; - inline JSBool HasInterface(XPCNativeInterface* aInterface) const; - inline JSBool HasInterfaceWithAncestor(XPCNativeInterface* aInterface) const; - inline JSBool HasInterfaceWithAncestor(const nsIID* iid) const; + inline bool HasInterface(XPCNativeInterface* aInterface) const; + inline bool HasInterfaceWithAncestor(XPCNativeInterface* aInterface) const; + inline bool HasInterfaceWithAncestor(const nsIID* iid) const; inline XPCNativeInterface* FindInterfaceWithIID(const nsIID& iid) const; @@ -1746,7 +1746,7 @@ class XPCNativeSet XPCNativeInterface* GetInterfaceAt(uint16_t i) {NS_ASSERTION(i < mInterfaceCount, "bad index"); return mInterfaces[i];} - inline JSBool MatchesSetUpToInterface(const XPCNativeSet* other, + inline bool MatchesSetUpToInterface(const XPCNativeSet* other, XPCNativeInterface* iface) const; #define XPC_NATIVE_SET_MARK_FLAG ((uint16_t)JS_BIT(15)) // only high bit of 16 is set @@ -1834,41 +1834,41 @@ class XPCNativeScriptableFlags void Mark() {mFlags |= XPC_WN_SJSFLAGS_MARK_FLAG;} void Unmark() {mFlags &= ~XPC_WN_SJSFLAGS_MARK_FLAG;} - JSBool IsMarked() const {return 0 != (mFlags & XPC_WN_SJSFLAGS_MARK_FLAG);} + bool IsMarked() const {return 0 != (mFlags & XPC_WN_SJSFLAGS_MARK_FLAG);} #ifdef GET_IT #undef GET_IT #endif #define GET_IT(f_) const {return 0 != (mFlags & nsIXPCScriptable:: f_ );} - JSBool WantPreCreate() GET_IT(WANT_PRECREATE) - JSBool WantCreate() GET_IT(WANT_CREATE) - JSBool WantPostCreate() GET_IT(WANT_POSTCREATE) - JSBool WantAddProperty() GET_IT(WANT_ADDPROPERTY) - JSBool WantDelProperty() GET_IT(WANT_DELPROPERTY) - JSBool WantGetProperty() GET_IT(WANT_GETPROPERTY) - JSBool WantSetProperty() GET_IT(WANT_SETPROPERTY) - JSBool WantEnumerate() GET_IT(WANT_ENUMERATE) - JSBool WantNewEnumerate() GET_IT(WANT_NEWENUMERATE) - JSBool WantNewResolve() GET_IT(WANT_NEWRESOLVE) - JSBool WantConvert() GET_IT(WANT_CONVERT) - JSBool WantFinalize() GET_IT(WANT_FINALIZE) - JSBool WantCheckAccess() GET_IT(WANT_CHECKACCESS) - JSBool WantCall() GET_IT(WANT_CALL) - JSBool WantConstruct() GET_IT(WANT_CONSTRUCT) - JSBool WantHasInstance() GET_IT(WANT_HASINSTANCE) - JSBool WantOuterObject() GET_IT(WANT_OUTER_OBJECT) - JSBool UseJSStubForAddProperty() GET_IT(USE_JSSTUB_FOR_ADDPROPERTY) - JSBool UseJSStubForDelProperty() GET_IT(USE_JSSTUB_FOR_DELPROPERTY) - JSBool UseJSStubForSetProperty() GET_IT(USE_JSSTUB_FOR_SETPROPERTY) - JSBool DontEnumStaticProps() GET_IT(DONT_ENUM_STATIC_PROPS) - JSBool DontEnumQueryInterface() GET_IT(DONT_ENUM_QUERY_INTERFACE) - JSBool DontAskInstanceForScriptable() GET_IT(DONT_ASK_INSTANCE_FOR_SCRIPTABLE) - JSBool ClassInfoInterfacesOnly() GET_IT(CLASSINFO_INTERFACES_ONLY) - JSBool AllowPropModsDuringResolve() GET_IT(ALLOW_PROP_MODS_DURING_RESOLVE) - JSBool AllowPropModsToPrototype() GET_IT(ALLOW_PROP_MODS_TO_PROTOTYPE) - JSBool IsGlobalObject() GET_IT(IS_GLOBAL_OBJECT) - JSBool DontReflectInterfaceNames() GET_IT(DONT_REFLECT_INTERFACE_NAMES) + bool WantPreCreate() GET_IT(WANT_PRECREATE) + bool WantCreate() GET_IT(WANT_CREATE) + bool WantPostCreate() GET_IT(WANT_POSTCREATE) + bool WantAddProperty() GET_IT(WANT_ADDPROPERTY) + bool WantDelProperty() GET_IT(WANT_DELPROPERTY) + bool WantGetProperty() GET_IT(WANT_GETPROPERTY) + bool WantSetProperty() GET_IT(WANT_SETPROPERTY) + bool WantEnumerate() GET_IT(WANT_ENUMERATE) + bool WantNewEnumerate() GET_IT(WANT_NEWENUMERATE) + bool WantNewResolve() GET_IT(WANT_NEWRESOLVE) + bool WantConvert() GET_IT(WANT_CONVERT) + bool WantFinalize() GET_IT(WANT_FINALIZE) + bool WantCheckAccess() GET_IT(WANT_CHECKACCESS) + bool WantCall() GET_IT(WANT_CALL) + bool WantConstruct() GET_IT(WANT_CONSTRUCT) + bool WantHasInstance() GET_IT(WANT_HASINSTANCE) + bool WantOuterObject() GET_IT(WANT_OUTER_OBJECT) + bool UseJSStubForAddProperty() GET_IT(USE_JSSTUB_FOR_ADDPROPERTY) + bool UseJSStubForDelProperty() GET_IT(USE_JSSTUB_FOR_DELPROPERTY) + bool UseJSStubForSetProperty() GET_IT(USE_JSSTUB_FOR_SETPROPERTY) + bool DontEnumStaticProps() GET_IT(DONT_ENUM_STATIC_PROPS) + bool DontEnumQueryInterface() GET_IT(DONT_ENUM_QUERY_INTERFACE) + bool DontAskInstanceForScriptable() GET_IT(DONT_ASK_INSTANCE_FOR_SCRIPTABLE) + bool ClassInfoInterfacesOnly() GET_IT(CLASSINFO_INTERFACES_ONLY) + bool AllowPropModsDuringResolve() GET_IT(ALLOW_PROP_MODS_DURING_RESOLVE) + bool AllowPropModsToPrototype() GET_IT(ALLOW_PROP_MODS_TO_PROTOTYPE) + bool IsGlobalObject() GET_IT(IS_GLOBAL_OBJECT) + bool DontReflectInterfaceNames() GET_IT(DONT_REFLECT_INTERFACE_NAMES) #undef GET_IT }; @@ -1921,7 +1921,7 @@ class XPCNativeScriptableShared void Mark() {mFlags.Mark();} void Unmark() {mFlags.Unmark();} - JSBool IsMarked() const {return mFlags.IsMarked();} + bool IsMarked() const {return mFlags.IsMarked();} private: XPCNativeScriptableFlags mFlags; @@ -2078,11 +2078,11 @@ class XPCWrappedNativeProto #endif #define GET_IT(f_) const {return !!(mClassInfoFlags & nsIClassInfo:: f_ );} - JSBool ClassIsSingleton() GET_IT(SINGLETON) - JSBool ClassIsThreadSafe() GET_IT(THREADSAFE) - JSBool ClassIsMainThreadOnly() GET_IT(MAIN_THREAD_ONLY) - JSBool ClassIsDOMObject() GET_IT(DOM_OBJECT) - JSBool ClassIsPluginObject() GET_IT(PLUGIN_OBJECT) + bool ClassIsSingleton() GET_IT(SINGLETON) + bool ClassIsThreadSafe() GET_IT(THREADSAFE) + bool ClassIsMainThreadOnly() GET_IT(MAIN_THREAD_ONLY) + bool ClassIsDOMObject() GET_IT(DOM_OBJECT) + bool ClassIsPluginObject() GET_IT(PLUGIN_OBJECT) #undef GET_IT @@ -2150,8 +2150,8 @@ class XPCWrappedNativeProto uint32_t ClassInfoFlags, XPCNativeSet* Set); - JSBool Init(const XPCNativeScriptableCreateInfo* scriptableCreateInfo, - bool callPostCreatePrototype); + bool Init(const XPCNativeScriptableCreateInfo* scriptableCreateInfo, + bool callPostCreatePrototype); private: #if defined(DEBUG_xpc_hacker) || defined(DEBUG) @@ -2175,9 +2175,9 @@ class XPCWrappedNativeProto class XPCWrappedNativeTearOff { public: - JSBool IsAvailable() const {return mInterface == nullptr;} - JSBool IsReserved() const {return mInterface == (XPCNativeInterface*)1;} - JSBool IsValid() const {return !IsAvailable() && !IsReserved();} + bool IsAvailable() const {return mInterface == nullptr;} + bool IsReserved() const {return mInterface == (XPCNativeInterface*)1;} + bool IsValid() const {return !IsAvailable() && !IsReserved();} void SetReserved() {mInterface = (XPCNativeInterface*)1;} XPCNativeInterface* GetInterface() const {return mInterface;} @@ -2275,7 +2275,7 @@ class XPCWrappedNative : public nsIXPConnectWrappedNative nsIPrincipal* GetObjectPrincipal() const; - JSBool + bool IsValid() const { return mFlatJSObject.hasFlag(FLAT_JS_OBJECT_VALID); } #define XPC_SCOPE_WORD(s) (intptr_t(s)) @@ -2283,7 +2283,7 @@ class XPCWrappedNative : public nsIXPConnectWrappedNative #define XPC_SCOPE_TAG (intptr_t(0x1)) #define XPC_WRAPPER_EXPIRED (intptr_t(0x2)) - static inline JSBool + static inline bool IsTaggedScope(XPCWrappedNativeScope* s) {return XPC_SCOPE_WORD(s) & XPC_SCOPE_TAG;} @@ -2296,11 +2296,11 @@ class XPCWrappedNative : public nsIXPConnectWrappedNative UnTagScope(XPCWrappedNativeScope* s) {return (XPCWrappedNativeScope*)(XPC_SCOPE_WORD(s) & ~XPC_SCOPE_TAG);} - inline JSBool + inline bool IsWrapperExpired() const {return XPC_SCOPE_WORD(mMaybeScope) & XPC_WRAPPER_EXPIRED;} - JSBool + bool HasProto() const {return !IsTaggedScope(mMaybeScope);} XPCWrappedNativeProto* @@ -2377,7 +2377,7 @@ class XPCWrappedNative : public nsIXPConnectWrappedNative GetClassInfo() const {return IsValid() && HasProto() ? GetProto()->GetClassInfo() : nullptr;} - JSBool + bool HasMutatedSet() const {return IsValid() && (!HasProto() || GetSet() != GetProto()->GetSet());} @@ -2425,20 +2425,20 @@ class XPCWrappedNative : public nsIXPConnectWrappedNative enum CallMode {CALL_METHOD, CALL_GETTER, CALL_SETTER}; - static JSBool CallMethod(XPCCallContext& ccx, - CallMode mode = CALL_METHOD); + static bool CallMethod(XPCCallContext& ccx, + CallMode mode = CALL_METHOD); - static JSBool GetAttribute(XPCCallContext& ccx) + static bool GetAttribute(XPCCallContext& ccx) {return CallMethod(ccx, CALL_GETTER);} - static JSBool SetAttribute(XPCCallContext& ccx) + static bool SetAttribute(XPCCallContext& ccx) {return CallMethod(ccx, CALL_SETTER);} - inline JSBool HasInterfaceNoQI(const nsIID& iid); + inline bool HasInterfaceNoQI(const nsIID& iid); XPCWrappedNativeTearOff* LocateTearOff(XPCNativeInterface* aInterface); XPCWrappedNativeTearOff* FindTearOff(XPCNativeInterface* aInterface, - JSBool needJSObject = false, + bool needJSObject = false, nsresult* pError = nullptr); void Mark() const { @@ -2503,11 +2503,11 @@ class XPCWrappedNative : public nsIXPConnectWrappedNative static void GatherProtoScriptableCreateInfo(nsIClassInfo* classInfo, XPCNativeScriptableCreateInfo& sciProto); - JSBool HasExternalReference() const {return mRefCnt > 1;} + bool HasExternalReference() const {return mRefCnt > 1;} - JSBool NeedsSOW() { return mWrapper.hasFlag(WRAPPER_NEEDS_SOW); } + bool NeedsSOW() { return mWrapper.hasFlag(WRAPPER_NEEDS_SOW); } void SetNeedsSOW() { mWrapper.setFlags(WRAPPER_NEEDS_SOW); } - JSBool NeedsCOW() { return mWrapper.hasFlag(WRAPPER_NEEDS_COW); } + bool NeedsCOW() { return mWrapper.hasFlag(WRAPPER_NEEDS_COW); } void SetNeedsCOW() { mWrapper.setFlags(WRAPPER_NEEDS_COW); } JSObject* GetWrapperPreserveColor() const { return mWrapper.getPtr(); } @@ -2572,16 +2572,16 @@ class XPCWrappedNative : public nsIXPConnectWrappedNative private: - JSBool Init(JS::HandleObject parent, const XPCNativeScriptableCreateInfo* sci); - JSBool FinishInit(); + bool Init(JS::HandleObject parent, const XPCNativeScriptableCreateInfo* sci); + bool FinishInit(); - JSBool ExtendSet(XPCNativeInterface* aInterface); + bool ExtendSet(XPCNativeInterface* aInterface); nsresult InitTearOff(XPCWrappedNativeTearOff* aTearOff, XPCNativeInterface* aInterface, - JSBool needJSObject); + bool needJSObject); - JSBool InitTearOffJSObject(XPCWrappedNativeTearOff* to); + bool InitTearOffJSObject(XPCWrappedNativeTearOff* to); public: static const XPCNativeScriptableCreateInfo& GatherScriptableCreateInfo(nsISupports* obj, @@ -2647,7 +2647,7 @@ class nsXPCWrappedJSClass : public nsIXPCWrappedJSClass nsIInterfaceInfo* GetInterfaceInfo() const {return mInfo;} const char* GetInterfaceName(); - static JSBool IsWrappedJS(nsISupports* aPtr); + static bool IsWrappedJS(nsISupports* aPtr); NS_IMETHOD DelegatedQueryInterface(nsXPCWrappedJS* self, REFNSIID aIID, void** aInstancePtr); @@ -2681,27 +2681,27 @@ class nsXPCWrappedJSClass : public nsIXPCWrappedJSClass nsXPCWrappedJSClass(JSContext* cx, REFNSIID aIID, nsIInterfaceInfo* aInfo); - JSBool IsReflectable(uint16_t i) const - {return (JSBool)(mDescriptors[i/32] & (1 << (i%32)));} - void SetReflectable(uint16_t i, JSBool b) + bool IsReflectable(uint16_t i) const + {return (bool)(mDescriptors[i/32] & (1 << (i%32)));} + void SetReflectable(uint16_t i, bool b) {if (b) mDescriptors[i/32] |= (1 << (i%32)); else mDescriptors[i/32] &= ~(1 << (i%32));} - JSBool GetArraySizeFromParam(JSContext* cx, - const XPTMethodDescriptor* method, - const nsXPTParamInfo& param, - uint16_t methodIndex, - uint8_t paramIndex, - nsXPTCMiniVariant* params, - uint32_t* result); - - JSBool GetInterfaceTypeFromParam(JSContext* cx, - const XPTMethodDescriptor* method, - const nsXPTParamInfo& param, - uint16_t methodIndex, - const nsXPTType& type, - nsXPTCMiniVariant* params, - nsID* result); + bool GetArraySizeFromParam(JSContext* cx, + const XPTMethodDescriptor* method, + const nsXPTParamInfo& param, + uint16_t methodIndex, + uint8_t paramIndex, + nsXPTCMiniVariant* params, + uint32_t* result); + + bool GetInterfaceTypeFromParam(JSContext* cx, + const XPTMethodDescriptor* method, + const nsXPTParamInfo& param, + uint16_t methodIndex, + const nsXPTType& type, + nsXPTCMiniVariant* params, + nsID* result); void CleanupPointerArray(const nsXPTType& datum_type, uint32_t array_count, @@ -2775,7 +2775,7 @@ class nsXPCWrappedJS : protected nsAutoXPTCStub, nsXPCWrappedJS* Find(REFNSIID aIID); nsXPCWrappedJS* FindInherited(REFNSIID aIID); - JSBool IsValid() const {return mJSObj != nullptr;} + bool IsValid() const {return mJSObj != nullptr;} void SystemIsBeingShutDown(JSRuntime* rt); // This is used by XPCJSRuntime::GCCallback to find wrappers that no @@ -2784,10 +2784,10 @@ class nsXPCWrappedJS : protected nsAutoXPTCStub, // last (outside) reference was released. Wrappers that fit into that // category are only deleted when we see that their corresponding JSObject // is to be finalized. - JSBool IsSubjectToFinalization() const {return IsValid() && mRefCnt == 1;} - JSBool IsObjectAboutToBeFinalized() {return JS_IsAboutToBeFinalized(&mJSObj);} + bool IsSubjectToFinalization() const {return IsValid() && mRefCnt == 1;} + bool IsObjectAboutToBeFinalized() {return JS_IsAboutToBeFinalized(&mJSObj);} - JSBool IsAggregatedToNative() const {return mRoot->mOuter != nullptr;} + bool IsAggregatedToNative() const {return mRoot->mOuter != nullptr;} nsISupports* GetAggregatedNativeObject() const {return mRoot->mOuter;} void SetIsMainThreadOnly() { @@ -2874,7 +2874,7 @@ class xpcProperty : public nsIProperty class XPCConvert { public: - static JSBool IsMethodReflectable(const XPTMethodDescriptor& info); + static bool IsMethodReflectable(const XPTMethodDescriptor& info); /** * Convert a native object into a jsval. @@ -2888,14 +2888,14 @@ class XPCConvert * @param pErr [out] relevant error code, if any. */ - static JSBool NativeData2JS(jsval* d, - const void* s, const nsXPTType& type, - const nsID* iid, nsresult* pErr); + static bool NativeData2JS(jsval* d, + const void* s, const nsXPTType& type, + const nsID* iid, nsresult* pErr); - static JSBool JSData2Native(void* d, JS::HandleValue s, - const nsXPTType& type, - JSBool useAllocator, const nsID* iid, - nsresult* pErr); + static bool JSData2Native(void* d, JS::HandleValue s, + const nsXPTType& type, + bool useAllocator, const nsID* iid, + nsresult* pErr); /** * Convert a native nsISupports into a JSObject. @@ -2912,22 +2912,22 @@ class XPCConvert * @param src_is_identity optional performance hint. Set to true only * if src is the identity pointer. */ - static JSBool NativeInterface2JSObject(jsval* d, - nsIXPConnectJSObjectHolder** dest, - xpcObjectHelper& aHelper, - const nsID* iid, - XPCNativeInterface** Interface, - bool allowNativeWrapper, - nsresult* pErr); - - static JSBool GetNativeInterfaceFromJSObject(void** dest, JSObject* src, - const nsID* iid, - nsresult* pErr); - static JSBool JSObject2NativeInterface(void** dest, JS::HandleObject src, - const nsID* iid, - nsISupports* aOuter, - nsresult* pErr); - static JSBool GetISupportsFromJSObject(JSObject* obj, nsISupports** iface); + static bool NativeInterface2JSObject(jsval* d, + nsIXPConnectJSObjectHolder** dest, + xpcObjectHelper& aHelper, + const nsID* iid, + XPCNativeInterface** Interface, + bool allowNativeWrapper, + nsresult* pErr); + + static bool GetNativeInterfaceFromJSObject(void** dest, JSObject* src, + const nsID* iid, + nsresult* pErr); + static bool JSObject2NativeInterface(void** dest, JS::HandleObject src, + const nsID* iid, + nsISupports* aOuter, + nsresult* pErr); + static bool GetISupportsFromJSObject(JSObject* obj, nsISupports** iface); /** * Convert a native array into a jsval. @@ -2940,28 +2940,28 @@ class XPCConvert * @param scope the default scope to put on the new JSObjects' parent chain * @param pErr [out] relevant error code, if any. */ - static JSBool NativeArray2JS(jsval* d, const void** s, - const nsXPTType& type, const nsID* iid, - uint32_t count, nsresult* pErr); + static bool NativeArray2JS(jsval* d, const void** s, + const nsXPTType& type, const nsID* iid, + uint32_t count, nsresult* pErr); - static JSBool JSArray2Native(void** d, JS::HandleValue s, - uint32_t count, const nsXPTType& type, - const nsID* iid, nsresult* pErr); + static bool JSArray2Native(void** d, JS::HandleValue s, + uint32_t count, const nsXPTType& type, + const nsID* iid, nsresult* pErr); - static JSBool JSTypedArray2Native(void** d, - JSObject* jsarray, - uint32_t count, - const nsXPTType& type, - nsresult* pErr); + static bool JSTypedArray2Native(void** d, + JSObject* jsarray, + uint32_t count, + const nsXPTType& type, + nsresult* pErr); - static JSBool NativeStringWithSize2JS(jsval* d, const void* s, - const nsXPTType& type, - uint32_t count, - nsresult* pErr); + static bool NativeStringWithSize2JS(jsval* d, const void* s, + const nsXPTType& type, + uint32_t count, + nsresult* pErr); - static JSBool JSStringWithSize2Native(void* d, JS::HandleValue s, - uint32_t count, const nsXPTType& type, - nsresult* pErr); + static bool JSStringWithSize2Native(void* d, JS::HandleValue s, + uint32_t count, const nsXPTType& type, + nsresult* pErr); static nsresult JSValToXPCException(JS::MutableHandleValue s, const char* ifaceName, @@ -2997,20 +2997,20 @@ class XPCThrower static void Throw(nsresult rv, XPCCallContext& ccx); static void ThrowBadResult(nsresult rv, nsresult result, XPCCallContext& ccx); static void ThrowBadParam(nsresult rv, unsigned paramNum, XPCCallContext& ccx); - static JSBool SetVerbosity(JSBool state) - {JSBool old = sVerbose; sVerbose = state; return old;} + static bool SetVerbosity(bool state) + {bool old = sVerbose; sVerbose = state; return old;} static void BuildAndThrowException(JSContext* cx, nsresult rv, const char* sz); - static JSBool CheckForPendingException(nsresult result, JSContext *cx); + static bool CheckForPendingException(nsresult result, JSContext *cx); private: static void Verbosify(XPCCallContext& ccx, char** psz, bool own); - static JSBool ThrowExceptionObject(JSContext* cx, nsIException* e); + static bool ThrowExceptionObject(JSContext* cx, nsIException* e); private: - static JSBool sVerbose; + static bool sVerbose; }; @@ -3051,9 +3051,9 @@ class nsXPCException : nsISupports *aData, nsIException** exception); - static JSBool NameAndFormatForNSResult(nsresult rv, - const char** name, - const char** format); + static bool NameAndFormatForNSResult(nsresult rv, + const char** name, + const char** format); static const void* IterateNSResults(nsresult* rv, const char** name, @@ -3082,7 +3082,7 @@ class nsXPCException : nsAutoJSValHolder mThrownJSVal; - static JSBool sEverMadeOneFromFactory; + static bool sEverMadeOneFromFactory; }; /***************************************************************************/ @@ -3265,7 +3265,7 @@ class nsXPCComponents : public nsIXPCComponents, NS_DECL_NSISECURITYCHECKEDCOMPONENT public: - static JSBool + static bool AttachComponentsObject(JSContext* aCx, XPCWrappedNativeScope* aScope); void SystemIsBeingShutDown() {ClearMembers();} @@ -3299,27 +3299,27 @@ xpc_NewIDObject(JSContext *cx, JS::HandleObject jsobj, const nsID& aID); extern const nsID* xpc_JSObjectToID(JSContext *cx, JSObject* obj); -extern JSBool +extern bool xpc_JSObjectIsID(JSContext *cx, JSObject* obj); /***************************************************************************/ // in XPCDebug.cpp -extern JSBool -xpc_DumpJSStack(JSContext* cx, JSBool showArgs, JSBool showLocals, - JSBool showThisProps); +extern bool +xpc_DumpJSStack(JSContext* cx, bool showArgs, bool showLocals, + bool showThisProps); // Return a newly-allocated string containing a representation of the // current JS stack. It is the *caller's* responsibility to free this // string with JS_smprintf_free(). extern char* -xpc_PrintJSStack(JSContext* cx, JSBool showArgs, JSBool showLocals, - JSBool showThisProps); +xpc_PrintJSStack(JSContext* cx, bool showArgs, bool showLocals, + bool showThisProps); -extern JSBool +extern bool xpc_DumpEvalInJSStackFrame(JSContext* cx, uint32_t frameno, const char* text); -extern JSBool +extern bool xpc_InstallJSDebuggerKeywordHandler(JSRuntime* rt); /***************************************************************************/ @@ -3627,8 +3627,8 @@ class XPCVariant : public nsIVariant * @param pErr [out] relevant error code, if any. * @param pJSVal [out] the resulting jsval. */ - static JSBool VariantDataToJS(nsIVariant* variant, - nsresult* pErr, jsval* pJSVal); + static bool VariantDataToJS(nsIVariant* variant, + nsresult* pErr, jsval* pJSVal); bool IsPurple() { @@ -3649,7 +3649,7 @@ class XPCVariant : public nsIVariant protected: virtual ~XPCVariant() { } - JSBool InitializeData(JSContext* cx); + bool InitializeData(JSContext* cx); protected: nsDiscriminatedUnion mData; @@ -3745,7 +3745,7 @@ xpc_EvalInSandbox(JSContext *cx, JS::HandleObject sandbox, const nsAString& sour /***************************************************************************/ // Inlined utilities. -inline JSBool +inline bool xpc_ForcePropertyResolve(JSContext* cx, JSObject* obj, jsid id); inline jsid @@ -3852,8 +3852,8 @@ GetObjectScope(JSObject *obj) return EnsureCompartmentPrivate(obj)->scope; } -extern JSBool gDebugMode; -extern JSBool gDesiredDebugMode; +extern bool gDebugMode; +extern bool gDesiredDebugMode; JSObject* NewOutObject(JSContext* cx, JSObject* scope); bool IsOutObject(JSContext* cx, JSObject* obj); diff --git a/js/xpconnect/src/xpcpublic.h b/js/xpconnect/src/xpcpublic.h index 5a4f1a35d99a1..6f9ab995ae1cd 100644 --- a/js/xpconnect/src/xpcpublic.h +++ b/js/xpconnect/src/xpcpublic.h @@ -118,7 +118,7 @@ xpc_FastGetCachedWrapper(nsWrapperCache *cache, JSObject *scope, jsval *vp) // The JS GC marks objects gray that are held alive directly or // indirectly by an XPConnect root. The cycle collector explores only // this subset of the JS heap. -inline JSBool +inline bool xpc_IsGrayGCThing(void *thing) { return JS::GCThingIsMarkedGray(thing); @@ -126,7 +126,7 @@ xpc_IsGrayGCThing(void *thing) // The cycle collector only cares about some kinds of GCthings that are // reachable from an XPConnect root. Implemented in nsXPConnect.cpp. -extern JSBool +extern bool xpc_GCThingIsGrayCCThing(void *thing); // Unmark gray for known-nonnull cases diff --git a/js/xpconnect/wrappers/AccessCheck.cpp b/js/xpconnect/wrappers/AccessCheck.cpp index dba9cb1018be9..dbe0093fde203 100644 --- a/js/xpconnect/wrappers/AccessCheck.cpp +++ b/js/xpconnect/wrappers/AccessCheck.cpp @@ -306,7 +306,7 @@ ExposedPropertiesOnly::check(JSContext *cx, JSObject *wrapperArg, jsid idArg, Wr // Unfortunately, |cx| can be in either compartment when we call ::check. :-( JSAutoCompartment ac(cx, wrappedObject); - JSBool found = false; + bool found = false; if (!JS_HasPropertyById(cx, wrappedObject, exposedPropsId, &found)) return false; diff --git a/js/xpconnect/wrappers/XrayWrapper.cpp b/js/xpconnect/wrappers/XrayWrapper.cpp index 08dc2a8bc6b81..413c491407f9f 100644 --- a/js/xpconnect/wrappers/XrayWrapper.cpp +++ b/js/xpconnect/wrappers/XrayWrapper.cpp @@ -535,7 +535,7 @@ XPCWrappedNativeXrayTraits::isResolving(JSContext *cx, JSObject *holder, // Some DOM objects have shared properties that don't have an explicit // getter/setter and rely on the class getter/setter. We install a // class getter/setter on the holder object to trigger them. -JSBool +bool holder_get(JSContext *cx, HandleObject wrapper, HandleId id, MutableHandleValue vp) { // JSClass::getProperty is wacky enough that it's hard to be sure someone @@ -559,8 +559,8 @@ holder_get(JSContext *cx, HandleObject wrapper, HandleId id, MutableHandleValue return true; } -JSBool -holder_set(JSContext *cx, HandleObject wrapper, HandleId id, JSBool strict, MutableHandleValue vp) +bool +holder_set(JSContext *cx, HandleObject wrapper, HandleId id, bool strict, MutableHandleValue vp) { // JSClass::setProperty is wacky enough that it's hard to be sure someone // can't inherit this getter by prototyping a random object to an @@ -780,7 +780,7 @@ XPCWrappedNativeXrayTraits::resolveNativeProperty(JSContext *cx, HandleObject wr desc->getter, desc->setter, desc->attrs); } -static JSBool +static bool wrappedJSObject_getter(JSContext *cx, HandleObject wrapper, HandleId id, MutableHandleValue vp) { if (!IsWrapper(wrapper) || !WrapperFactory::IsXrayWrapper(wrapper)) { @@ -858,7 +858,7 @@ XPCWrappedNativeXrayTraits::resolveOwnProperty(JSContext *cx, Wrapper &jsWrapper // in the wrapper's compartment here, not the wrappee. MOZ_ASSERT(js::IsObjectInContextCompartment(wrapper, cx)); - JSBool hasProp; + bool hasProp; if (!JS_HasPropertyById(cx, holder, id, &hasProp)) { return false; } @@ -947,7 +947,7 @@ XPCWrappedNativeXrayTraits::enumerateNames(JSContext *cx, HandleObject wrapper, // Go through the properties we got and enumerate all native ones. for (size_t n = 0; n < wnProps.length(); ++n) { RootedId id(cx, wnProps[n]); - JSBool hasProp; + bool hasProp; if (!JS_HasPropertyById(cx, wrapper, id, &hasProp)) return false; if (hasProp) @@ -1210,7 +1210,7 @@ HasNativeProperty(JSContext *cx, HandleObject wrapper, HandleId id, bool *hasPro } // Try the holder. - JSBool found = false; + bool found = false; if (!JS_AlreadyHasOwnPropertyById(cx, holder, id, &found)) return false; if (found) { diff --git a/js/xpconnect/wrappers/XrayWrapper.h b/js/xpconnect/wrappers/XrayWrapper.h index 3a936346debeb..e5a6ab1261aec 100644 --- a/js/xpconnect/wrappers/XrayWrapper.h +++ b/js/xpconnect/wrappers/XrayWrapper.h @@ -21,10 +21,10 @@ class XPCWrappedNative; namespace xpc { -JSBool +bool holder_get(JSContext *cx, JS::HandleObject holder, JS::HandleId id, JS::MutableHandleValue vp); -JSBool -holder_set(JSContext *cx, JS::HandleObject holder, JS::HandleId id, JSBool strict, +bool +holder_set(JSContext *cx, JS::HandleObject holder, JS::HandleId id, bool strict, JS::MutableHandleValue vp); namespace XrayUtils { diff --git a/netwerk/base/src/ProxyAutoConfig.cpp b/netwerk/base/src/ProxyAutoConfig.cpp index 465767980b8e4..40e49f731e098 100644 --- a/netwerk/base/src/ProxyAutoConfig.cpp +++ b/netwerk/base/src/ProxyAutoConfig.cpp @@ -315,8 +315,8 @@ PACErrorReporter(JSContext *cx, const char *message, JSErrorReport *report) // timeout of 0 means the normal necko timeout strategy, otherwise the dns request // will be canceled after aTimeout milliseconds static -JSBool PACResolve(const nsCString &aHostName, NetAddr *aNetAddr, - unsigned int aTimeout) +bool PACResolve(const nsCString &aHostName, NetAddr *aNetAddr, + unsigned int aTimeout) { if (!sRunning) { NS_WARNING("PACResolve without a running ProxyAutoConfig object"); @@ -658,7 +658,7 @@ ProxyAutoConfig::GetProxyForURI(const nsCString &aTestURI, JS::Value argv[2] = { uriValue, hostValue }; JS::Rooted rval(cx); - JSBool ok = JS_CallFunctionName(cx, mJSRuntime->Global(), + bool ok = JS_CallFunctionName(cx, mJSRuntime->Global(), "FindProxyForURL", 2, argv, rval.address()); if (ok && rval.isString()) { diff --git a/netwerk/protocol/http/nsHttpChannelAuthProvider.cpp b/netwerk/protocol/http/nsHttpChannelAuthProvider.cpp index 9becf00469fed..29904183f6025 100644 --- a/netwerk/protocol/http/nsHttpChannelAuthProvider.cpp +++ b/netwerk/protocol/http/nsHttpChannelAuthProvider.cpp @@ -1203,8 +1203,6 @@ nsHttpChannelAuthProvider::ConfirmAuth(const nsString &bundleKey, bool confirmed; if (doYesNoPrompt) { int32_t choice; - // The actual value is irrelevant but we shouldn't be handing out - // malformed JSBools to XPConnect. bool checkState = false; rv = prompt->ConfirmEx(nullptr, msg, nsIPrompt::BUTTON_POS_1_DEFAULT + diff --git a/security/manager/ssl/src/nsCrypto.cpp b/security/manager/ssl/src/nsCrypto.cpp index 13b36e43acbcc..915a422a135f6 100644 --- a/security/manager/ssl/src/nsCrypto.cpp +++ b/security/manager/ssl/src/nsCrypto.cpp @@ -2206,7 +2206,7 @@ nsCryptoRunnable::Run() JSAutoRequest ar(cx); JSAutoCompartment ac(cx, m_args->m_scope); - JSBool ok = + bool ok = JS_EvaluateScriptForPrincipals(cx, m_args->m_scope, nsJSPrincipals::get(m_args->m_principals), m_args->m_jsCallback, diff --git a/startupcache/test/TestStartupCache.cpp b/startupcache/test/TestStartupCache.cpp index 9c8bf469ef348..fb5d1b0849141 100644 --- a/startupcache/test/TestStartupCache.cpp +++ b/startupcache/test/TestStartupCache.cpp @@ -445,7 +445,7 @@ CompareCountArrays(JSContext *cx, JSObject *aBefore, JSObject *aAfter) return NS_ERROR_UNEXPECTED; } - JSBool same = true; + bool same = true; if (!JS_LooselyEqual(cx, before_num, after_num, &same)) { return NS_ERROR_UNEXPECTED; } else { diff --git a/toolkit/components/ctypes/ctypes.cpp b/toolkit/components/ctypes/ctypes.cpp index e56a38e2c4ccc..3489d22891f35 100644 --- a/toolkit/components/ctypes/ctypes.cpp +++ b/toolkit/components/ctypes/ctypes.cpp @@ -63,7 +63,7 @@ Module::~Module() #define XPC_MAP_FLAGS nsIXPCScriptable::WANT_CALL #include "xpc_map_end.h" -static JSBool +static bool SealObjectAndPrototype(JSContext* cx, JSObject* parent, const char* name) { JS::Rooted prop(cx); @@ -83,7 +83,7 @@ SealObjectAndPrototype(JSContext* cx, JSObject* parent, const char* name) return JS_FreezeObject(cx, obj) && JS_FreezeObject(cx, prototype); } -static JSBool +static bool InitAndSealCTypesClass(JSContext* cx, JS::Handle global) { // Init the ctypes object. diff --git a/toolkit/components/perf/PerfMeasurement.cpp b/toolkit/components/perf/PerfMeasurement.cpp index 09df1d90f9b2d..ec8020b1e37ff 100644 --- a/toolkit/components/perf/PerfMeasurement.cpp +++ b/toolkit/components/perf/PerfMeasurement.cpp @@ -38,7 +38,7 @@ Module::~Module() #define XPC_MAP_FLAGS nsIXPCScriptable::WANT_CALL #include "xpc_map_end.h" -static JSBool +static bool SealObjectAndPrototype(JSContext* cx, JSObject* parent, const char* name) { JS::Rooted prop(cx); @@ -58,7 +58,7 @@ SealObjectAndPrototype(JSContext* cx, JSObject* parent, const char* name) return JS_FreezeObject(cx, obj) && JS_FreezeObject(cx, prototype); } -static JSBool +static bool InitAndSealPerfMeasurementClass(JSContext* cx, JS::Handle global) { // Init the PerfMeasurement class diff --git a/toolkit/components/places/History.cpp b/toolkit/components/places/History.cpp index 0af3ecbef7dae..993e60d211a99 100644 --- a/toolkit/components/places/History.cpp +++ b/toolkit/components/places/History.cpp @@ -251,7 +251,7 @@ GetJSArrayFromJSValue(const JS::Value& aValue, *_array = JS_NewArrayObject(aCtx, 0, nullptr); NS_ENSURE_TRUE(*_array, NS_ERROR_OUT_OF_MEMORY); - JSBool rc = JS_DefineElement(aCtx, *_array, 0, aValue, nullptr, nullptr, 0); + bool rc = JS_DefineElement(aCtx, *_array, 0, aValue, nullptr, nullptr, 0); NS_ENSURE_TRUE(rc, NS_ERROR_UNEXPECTED); return NS_OK; } @@ -297,7 +297,7 @@ GetURIFromJSObject(JSContext* aCtx, const char* aProperty) { JS::Rooted uriVal(aCtx); - JSBool rc = JS_GetProperty(aCtx, aObject, aProperty, &uriVal); + bool 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 val(aCtx); - JSBool rc = JS_GetProperty(aCtx, aObject, aProperty, &val); + bool rc = JS_GetProperty(aCtx, aObject, aProperty, &val); if (!rc) { _string.SetIsVoid(true); return; @@ -385,7 +385,7 @@ GetIntFromJSObject(JSContext* aCtx, IntType* _int) { JS::Rooted value(aCtx); - JSBool rc = JS_GetProperty(aCtx, aObject, aProperty, &value); + bool rc = JS_GetProperty(aCtx, aObject, aProperty, &value); NS_ENSURE_TRUE(rc, NS_ERROR_UNEXPECTED); if (JSVAL_IS_VOID(value)) { return NS_ERROR_INVALID_ARG; @@ -426,7 +426,7 @@ GetJSObjectFromArray(JSContext* aCtx, "Must provide an object that is an array!"); JS::Rooted value(aCtx); - JSBool rc = JS_GetElement(aCtx, aArray, aIndex, &value); + bool rc = JS_GetElement(aCtx, aArray, aIndex, &value); NS_ENSURE_TRUE(rc, NS_ERROR_UNEXPECTED); NS_ENSURE_ARG(!JSVAL_IS_PRIMITIVE(value)); *_rooter = JSVAL_TO_OBJECT(value); @@ -2707,7 +2707,7 @@ History::GetPlacesInfo(const JS::Value& aPlaceIdentifiers, placesInfo.SetCapacity(placesIndentifiersLength); for (uint32_t i = 0; i < placesIndentifiersLength; i++) { JS::Rooted placeIdentifier(aCtx); - JSBool rc = JS_GetElement(aCtx, placesIndentifiers, i, &placeIdentifier); + bool rc = JS_GetElement(aCtx, placesIndentifiers, i, &placeIdentifier); NS_ENSURE_TRUE(rc, NS_ERROR_UNEXPECTED); // GUID @@ -2808,7 +2808,7 @@ History::UpdatePlaces(const JS::Value& aPlaceInfos, JS::Rooted visits(aCtx, nullptr); { JS::Rooted visitsVal(aCtx); - JSBool rc = JS_GetProperty(aCtx, info, "visits", &visitsVal); + bool rc = JS_GetProperty(aCtx, info, "visits", &visitsVal); NS_ENSURE_TRUE(rc, NS_ERROR_UNEXPECTED); if (!JSVAL_IS_PRIMITIVE(visitsVal)) { visits = JSVAL_TO_OBJECT(visitsVal); diff --git a/toolkit/components/places/PlaceInfo.cpp b/toolkit/components/places/PlaceInfo.cpp index f6ea3983af1a6..e2a4695917aa2 100644 --- a/toolkit/components/places/PlaceInfo.cpp +++ b/toolkit/components/places/PlaceInfo.cpp @@ -118,7 +118,7 @@ PlaceInfo::GetVisits(JSContext* aContext, NS_ENSURE_STATE(jsobj); JS::Rooted wrappedVisit(aContext, OBJECT_TO_JSVAL(jsobj)); - JSBool rc = JS_SetElement(aContext, visits, idx, &wrappedVisit); + bool rc = JS_SetElement(aContext, visits, idx, &wrappedVisit); NS_ENSURE_TRUE(rc, NS_ERROR_UNEXPECTED); } diff --git a/toolkit/components/telemetry/Telemetry.cpp b/toolkit/components/telemetry/Telemetry.cpp index aa32e7467b775..5d89949a43c77 100644 --- a/toolkit/components/telemetry/Telemetry.cpp +++ b/toolkit/components/telemetry/Telemetry.cpp @@ -1508,9 +1508,9 @@ TelemetryImpl::GetChromeHangs(JSContext *cx, JS::Value *ret) if (!durationArray) { return NS_ERROR_FAILURE; } - JSBool ok = JS_DefineProperty(cx, fullReportObj, "durations", - OBJECT_TO_JSVAL(durationArray), - NULL, NULL, JSPROP_ENUMERATE); + bool ok = JS_DefineProperty(cx, fullReportObj, "durations", + OBJECT_TO_JSVAL(durationArray), + NULL, NULL, JSPROP_ENUMERATE); if (!ok) { return NS_ERROR_FAILURE; } @@ -1537,9 +1537,9 @@ CreateJSStackObject(JSContext *cx, const CombinedStacks &stacks) { if (!moduleArray) { return nullptr; } - JSBool ok = JS_DefineProperty(cx, ret, "memoryMap", - OBJECT_TO_JSVAL(moduleArray), - NULL, NULL, JSPROP_ENUMERATE); + bool ok = JS_DefineProperty(cx, ret, "memoryMap", + OBJECT_TO_JSVAL(moduleArray), + NULL, NULL, JSPROP_ENUMERATE); if (!ok) { return nullptr; } diff --git a/toolkit/crashreporter/google-breakpad/autotools/compile b/toolkit/crashreporter/google-breakpad/autotools/compile deleted file mode 120000 index cf0edba2876a1..0000000000000 --- a/toolkit/crashreporter/google-breakpad/autotools/compile +++ /dev/null @@ -1 +0,0 @@ -/usr/share/automake-1.11/compile \ No newline at end of file diff --git a/toolkit/crashreporter/google-breakpad/autotools/compile b/toolkit/crashreporter/google-breakpad/autotools/compile new file mode 100755 index 0000000000000..862a14e8c81cc --- /dev/null +++ b/toolkit/crashreporter/google-breakpad/autotools/compile @@ -0,0 +1,343 @@ +#! /bin/sh +# Wrapper for compilers which do not understand '-c -o'. + +scriptversion=2012-03-05.13; # UTC + +# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2009, 2010, 2012 Free +# Software Foundation, Inc. +# Written by Tom Tromey . +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# This file is maintained in Automake, please report +# bugs to or send patches to +# . + +nl=' +' + +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent tools from complaining about whitespace usage. +IFS=" "" $nl" + +file_conv= + +# func_file_conv build_file lazy +# Convert a $build file to $host form and store it in $file +# Currently only supports Windows hosts. If the determined conversion +# type is listed in (the comma separated) LAZY, no conversion will +# take place. +func_file_conv () +{ + file=$1 + case $file in + / | /[!/]*) # absolute file, and not a UNC file + if test -z "$file_conv"; then + # lazily determine how to convert abs files + case `uname -s` in + MINGW*) + file_conv=mingw + ;; + CYGWIN*) + file_conv=cygwin + ;; + *) + file_conv=wine + ;; + esac + fi + case $file_conv/,$2, in + *,$file_conv,*) + ;; + mingw/*) + file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` + ;; + cygwin/*) + file=`cygpath -m "$file" || echo "$file"` + ;; + wine/*) + file=`winepath -w "$file" || echo "$file"` + ;; + esac + ;; + esac +} + +# func_cl_dashL linkdir +# Make cl look for libraries in LINKDIR +func_cl_dashL () +{ + func_file_conv "$1" + if test -z "$lib_path"; then + lib_path=$file + else + lib_path="$lib_path;$file" + fi + linker_opts="$linker_opts -LIBPATH:$file" +} + +# func_cl_dashl library +# Do a library search-path lookup for cl +func_cl_dashl () +{ + lib=$1 + found=no + save_IFS=$IFS + IFS=';' + for dir in $lib_path $LIB + do + IFS=$save_IFS + if $shared && test -f "$dir/$lib.dll.lib"; then + found=yes + lib=$dir/$lib.dll.lib + break + fi + if test -f "$dir/$lib.lib"; then + found=yes + lib=$dir/$lib.lib + break + fi + done + IFS=$save_IFS + + if test "$found" != yes; then + lib=$lib.lib + fi +} + +# func_cl_wrapper cl arg... +# Adjust compile command to suit cl +func_cl_wrapper () +{ + # Assume a capable shell + lib_path= + shared=: + linker_opts= + for arg + do + if test -n "$eat"; then + eat= + else + case $1 in + -o) + # configure might choose to run compile as 'compile cc -o foo foo.c'. + eat=1 + case $2 in + *.o | *.[oO][bB][jJ]) + func_file_conv "$2" + set x "$@" -Fo"$file" + shift + ;; + *) + func_file_conv "$2" + set x "$@" -Fe"$file" + shift + ;; + esac + ;; + -I) + eat=1 + func_file_conv "$2" mingw + set x "$@" -I"$file" + shift + ;; + -I*) + func_file_conv "${1#-I}" mingw + set x "$@" -I"$file" + shift + ;; + -l) + eat=1 + func_cl_dashl "$2" + set x "$@" "$lib" + shift + ;; + -l*) + func_cl_dashl "${1#-l}" + set x "$@" "$lib" + shift + ;; + -L) + eat=1 + func_cl_dashL "$2" + ;; + -L*) + func_cl_dashL "${1#-L}" + ;; + -static) + shared=false + ;; + -Wl,*) + arg=${1#-Wl,} + save_ifs="$IFS"; IFS=',' + for flag in $arg; do + IFS="$save_ifs" + linker_opts="$linker_opts $flag" + done + IFS="$save_ifs" + ;; + -Xlinker) + eat=1 + linker_opts="$linker_opts $2" + ;; + -*) + set x "$@" "$1" + shift + ;; + *.cc | *.CC | *.cxx | *.CXX | *.[cC]++) + func_file_conv "$1" + set x "$@" -Tp"$file" + shift + ;; + *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO]) + func_file_conv "$1" mingw + set x "$@" "$file" + shift + ;; + *) + set x "$@" "$1" + shift + ;; + esac + fi + shift + done + if test -n "$linker_opts"; then + linker_opts="-link$linker_opts" + fi + exec "$@" $linker_opts + exit 1 +} + +eat= + +case $1 in + '') + echo "$0: No command. Try '$0 --help' for more information." 1>&2 + exit 1; + ;; + -h | --h*) + cat <<\EOF +Usage: compile [--help] [--version] PROGRAM [ARGS] + +Wrapper for compilers which do not understand '-c -o'. +Remove '-o dest.o' from ARGS, run PROGRAM with the remaining +arguments, and rename the output as expected. + +If you are trying to build a whole package this is not the +right script to run: please start by reading the file 'INSTALL'. + +Report bugs to . +EOF + exit $? + ;; + -v | --v*) + echo "compile $scriptversion" + exit $? + ;; + cl | *[/\\]cl | cl.exe | *[/\\]cl.exe ) + func_cl_wrapper "$@" # Doesn't return... + ;; +esac + +ofile= +cfile= + +for arg +do + if test -n "$eat"; then + eat= + else + case $1 in + -o) + # configure might choose to run compile as 'compile cc -o foo foo.c'. + # So we strip '-o arg' only if arg is an object. + eat=1 + case $2 in + *.o | *.obj) + ofile=$2 + ;; + *) + set x "$@" -o "$2" + shift + ;; + esac + ;; + *.c) + cfile=$1 + set x "$@" "$1" + shift + ;; + *) + set x "$@" "$1" + shift + ;; + esac + fi + shift +done + +if test -z "$ofile" || test -z "$cfile"; then + # If no '-o' option was seen then we might have been invoked from a + # pattern rule where we don't need one. That is ok -- this is a + # normal compilation that the losing compiler can handle. If no + # '.c' file was seen then we are probably linking. That is also + # ok. + exec "$@" +fi + +# Name of file we expect compiler to create. +cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` + +# Create the lock directory. +# Note: use '[/\\:.-]' here to ensure that we don't use the same name +# that we are using for the .o file. Also, base the name on the expected +# object file name, since that is what matters with a parallel build. +lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d +while true; do + if mkdir "$lockdir" >/dev/null 2>&1; then + break + fi + sleep 1 +done +# FIXME: race condition here if user kills between mkdir and trap. +trap "rmdir '$lockdir'; exit 1" 1 2 15 + +# Run the compile. +"$@" +ret=$? + +if test -f "$cofile"; then + test "$cofile" = "$ofile" || mv "$cofile" "$ofile" +elif test -f "${cofile}bj"; then + test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile" +fi + +rmdir "$lockdir" +exit $ret + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "; # UTC" +# End: diff --git a/toolkit/xre/nsAppRunner.cpp b/toolkit/xre/nsAppRunner.cpp index 5f989ea422a7a..2e33c77e958c5 100644 --- a/toolkit/xre/nsAppRunner.cpp +++ b/toolkit/xre/nsAppRunner.cpp @@ -1769,10 +1769,7 @@ ProfileLockedDialog(nsIFile* aProfileDir, nsIFile* aProfileLocalDir, nsIPromptService::BUTTON_POS_1) + nsIPromptService::BUTTON_POS_1_DEFAULT; - // The actual value is irrelevant but we shouldn't be handing out - // malformed JSBools to XPConnect. bool checkState = false; - rv = ps->ConfirmEx(nullptr, killTitle, killMessage, flags, killTitle, nullptr, nullptr, nullptr, &checkState, &button); diff --git a/tools/profiler/SaveProfileTask.cpp b/tools/profiler/SaveProfileTask.cpp index dccd64b84338e..4a564273432c2 100644 --- a/tools/profiler/SaveProfileTask.cpp +++ b/tools/profiler/SaveProfileTask.cpp @@ -6,7 +6,7 @@ #include "SaveProfileTask.h" #include "GeckoProfilerImpl.h" -static JSBool +static bool WriteCallback(const jschar *buf, uint32_t len, void *data) { std::ofstream& stream = *static_cast(data); diff --git a/widget/xpwidgets/GfxInfoCollector.h b/widget/xpwidgets/GfxInfoCollector.h index 93f1b8c993264..bafbfd66c8c2c 100644 --- a/widget/xpwidgets/GfxInfoCollector.h +++ b/widget/xpwidgets/GfxInfoCollector.h @@ -64,7 +64,7 @@ class MOZ_STACK_CLASS InfoObject JSContext *mCx; JS::Rooted mObj; - JSBool mOk; + bool mOk; }; /* diff --git a/xpcom/base/CycleCollectedJSRuntime.cpp b/xpcom/base/CycleCollectedJSRuntime.cpp index 1111c8af22199..78baf07364786 100644 --- a/xpcom/base/CycleCollectedJSRuntime.cpp +++ b/xpcom/base/CycleCollectedJSRuntime.cpp @@ -795,7 +795,7 @@ CycleCollectedJSRuntime::GCCallback(JSRuntime* aRuntime, self->OnGC(aStatus); } -/* static */ JSBool +/* static */ bool CycleCollectedJSRuntime::ContextCallback(JSContext* aContext, unsigned aOperation, void* aData) diff --git a/xpcom/base/CycleCollectedJSRuntime.h b/xpcom/base/CycleCollectedJSRuntime.h index 729623e5a373a..22848ac9e926e 100644 --- a/xpcom/base/CycleCollectedJSRuntime.h +++ b/xpcom/base/CycleCollectedJSRuntime.h @@ -159,8 +159,8 @@ class CycleCollectedJSRuntime static void TraceBlackJS(JSTracer* aTracer, void* aData); static void TraceGrayJS(JSTracer* aTracer, void* aData); static void GCCallback(JSRuntime* aRuntime, JSGCStatus aStatus, void* aData); - static JSBool ContextCallback(JSContext* aCx, unsigned aOperation, - void* aData); + static bool ContextCallback(JSContext* aCx, unsigned aOperation, + void* aData); virtual void TraceNativeBlackRoots(JSTracer* aTracer) { }; void TraceNativeGrayRoots(JSTracer* aTracer);