diff --git a/js/xpconnect/src/Sandbox.cpp b/js/xpconnect/src/Sandbox.cpp index 95e3ae02e530..c47f71c5bd6b 100644 --- a/js/xpconnect/src/Sandbox.cpp +++ b/js/xpconnect/src/Sandbox.cpp @@ -1843,7 +1843,7 @@ nsXPCComponents_utils_Sandbox::CallOrConstruct(nsIXPConnectWrappedNative* wrappe nsresult xpc::EvalInSandbox(JSContext* cx, HandleObject sandboxArg, const nsAString& source, const nsACString& filename, int32_t lineNo, - JSVersion jsVersion, MutableHandleValue rval) + MutableHandleValue rval) { JS_AbortIfWrongThread(cx); rval.set(UndefinedValue()); diff --git a/js/xpconnect/src/XPCComponents.cpp b/js/xpconnect/src/XPCComponents.cpp index d6d890070da9..cdc220596a7d 100644 --- a/js/xpconnect/src/XPCComponents.cpp +++ b/js/xpconnect/src/XPCComponents.cpp @@ -2211,24 +2211,7 @@ nsXPCComponents_Utils::EvalInSandbox(const nsAString& source, if (!JS_ValueToObject(cx, sandboxVal, &sandbox) || !sandbox) return NS_ERROR_INVALID_ARG; - // Optional third argument: JS version, as a string. - JSVersion jsVersion = JSVERSION_DEFAULT; - if (optionalArgc >= 1) { - JSString* jsVersionStr = ToString(cx, version); - if (!jsVersionStr) - return NS_ERROR_INVALID_ARG; - - JSAutoByteString bytes(cx, jsVersionStr); - if (!bytes) - return NS_ERROR_INVALID_ARG; - - // Treat non-default version designation as default. - if (JS_StringToVersion(bytes.ptr()) == JSVERSION_UNKNOWN && - strcmp(bytes.ptr(), "latest")) - { - return NS_ERROR_INVALID_ARG; - } - } + // Optional third argument: JS version, as a string, is unused. // Optional fourth and fifth arguments: filename and line number. int32_t lineNo = (optionalArgc >= 3) ? lineNumber : 1; @@ -2246,8 +2229,7 @@ nsXPCComponents_Utils::EvalInSandbox(const nsAString& source, } } - return xpc::EvalInSandbox(cx, sandbox, source, filename, lineNo, - jsVersion, retval); + return xpc::EvalInSandbox(cx, sandbox, source, filename, lineNo, retval); } NS_IMETHODIMP diff --git a/js/xpconnect/src/nsXPConnect.cpp b/js/xpconnect/src/nsXPConnect.cpp index 93a7dcefc1fb..6a86161e55fa 100644 --- a/js/xpconnect/src/nsXPConnect.cpp +++ b/js/xpconnect/src/nsXPConnect.cpp @@ -798,8 +798,7 @@ nsXPConnect::EvalInSandboxObject(const nsAString& source, const char* filename, } else { filenameStr = NS_LITERAL_CSTRING("x-bogus://XPConnect/Sandbox"); } - return EvalInSandbox(cx, sandbox, source, filenameStr, 1, - JSVERSION_DEFAULT, rval); + return EvalInSandbox(cx, sandbox, source, filenameStr, 1, rval); } NS_IMETHODIMP diff --git a/js/xpconnect/src/xpcprivate.h b/js/xpconnect/src/xpcprivate.h index bddb262047fe..1504a1a67ac0 100644 --- a/js/xpconnect/src/xpcprivate.h +++ b/js/xpconnect/src/xpcprivate.h @@ -2916,7 +2916,7 @@ CreateSandboxObject(JSContext* cx, JS::MutableHandleValue vp, nsISupports* prinO nsresult EvalInSandbox(JSContext* cx, JS::HandleObject sandbox, const nsAString& source, const nsACString& filename, int32_t lineNo, - JSVersion jsVersion, JS::MutableHandleValue rval); + JS::MutableHandleValue rval); nsresult GetSandboxAddonId(JSContext* cx, JS::HandleObject sandboxArg,