From 6c3e867c73c6525d5e8e344e079c436aa0842a10 Mon Sep 17 00:00:00 2001 From: Fedor Date: Sat, 19 Apr 2025 19:14:02 +0300 Subject: [PATCH] 68.14.8 - js --- js/public/Transcoding.h | 9 - js/public/friend/ErrorNumbers.msg | 1 - js/src/builtin/TestingFunctions.cpp | 14 +- js/src/jit-test/tests/asm.js/bug1542130.js | 6 +- js/src/jit-test/tests/asm.js/testBug893519.js | 6 +- .../tests/auto-regress/bug1466626-2.js | 6 +- .../jit-test/tests/auto-regress/bug677977.js | 1 - js/src/jit-test/tests/basic/bug1106982-2.js | 7 +- js/src/jit-test/tests/basic/bug1405820.js | 5 - js/src/jit-test/tests/basic/bug1412654.js | 4 - js/src/jit-test/tests/basic/bug751139.js | 7 - .../tests/basic/function-cloning-1.js | 4 - js/src/jit-test/tests/basic/testLet.js | 4 +- .../jit-test/tests/basic/testScriptCloning.js | 29 ++-- .../jit-test/tests/basic/weird-scopechains.js | 29 ++-- .../binast/lazy/auto-regress/bug677977.binjs | Bin 1297 -> 0 bytes .../tests/binast/lazy/basic/bug1405820.binjs | Bin 422 -> 0 bytes .../tests/binast/lazy/basic/bug1405820.dir | 1 - .../tests/binast/lazy/basic/bug751139.binjs | Bin 813 -> 0 bytes .../lazy/basic/function-cloning-1.binjs | Bin 463 -> 0 bytes .../tests/binast/lazy/basic/testLet.binjs | Bin 8796 -> 0 bytes .../binast/lazy/basic/testScriptCloning.binjs | Bin 1114 -> 0 bytes .../binast/lazy/basic/weird-scopechains.binjs | Bin 1085 -> 0 bytes .../binast/lazy/debug/Source-invisible.binjs | Bin 712 -> 0 bytes .../tests/binast/lazy/debug/bug1406437.binjs | Bin 759 -> 0 bytes .../binast/lazy/debug/onNewScript-01.binjs | Bin 1435 -> 0 bytes .../binast/lazy/debug/onNewScript-02.binjs | Bin 2274 -> 0 bytes .../tests/binast/lazy/gc/bug-1161968.binjs | Bin 542 -> 0 bytes .../tests/binast/lazy/gc/bug-1161968.dir | 1 - .../nonlazy/auto-regress/bug677977.binjs | Bin 1296 -> 0 bytes .../binast/nonlazy/basic/bug1405820.binjs | Bin 422 -> 0 bytes .../tests/binast/nonlazy/basic/bug1405820.dir | 1 - .../binast/nonlazy/basic/bug751139.binjs | Bin 813 -> 0 bytes .../nonlazy/basic/function-cloning-1.binjs | Bin 463 -> 0 bytes .../tests/binast/nonlazy/basic/testLet.binjs | Bin 8792 -> 0 bytes .../nonlazy/basic/testScriptCloning.binjs | Bin 1114 -> 0 bytes .../nonlazy/basic/weird-scopechains.binjs | Bin 1058 -> 0 bytes .../nonlazy/debug/Source-invisible.binjs | Bin 712 -> 0 bytes .../binast/nonlazy/debug/bug1406437.binjs | Bin 759 -> 0 bytes .../binast/nonlazy/debug/onNewScript-01.binjs | Bin 1434 -> 0 bytes .../binast/nonlazy/debug/onNewScript-02.binjs | Bin 2261 -> 0 bytes .../tests/binast/nonlazy/gc/bug-1161968.binjs | Bin 542 -> 0 bytes .../tests/binast/nonlazy/gc/bug-1161968.dir | 1 - .../jit-test/tests/debug/Source-invisible.js | 4 +- js/src/jit-test/tests/debug/bug1406437.js | 3 +- js/src/jit-test/tests/debug/onNewScript-01.js | 3 +- js/src/jit-test/tests/debug/onNewScript-02.js | 2 +- js/src/jit-test/tests/gc/bug-1161968.js | 4 +- js/src/jsapi-tests/moz.build | 1 - js/src/jsapi-tests/testCloneScript.cpp | 157 ------------------ js/src/jsapi.cpp | 130 --------------- js/src/jsapi.h | 19 --- js/src/jsfriendapi.h | 20 --- js/src/shell/js.cpp | 57 ------- js/src/tests/non262/async-functions/clone.js | 15 +- .../tests/non262/extensions/regress-300079.js | 6 +- js/src/tests/non262/regress/regress-127557.js | 76 --------- js/src/vm/JSObject.cpp | 12 +- js/xpconnect/crashtests/471366-1.html | 12 -- js/xpconnect/crashtests/crashtests.list | 1 - js/xpconnect/idl/nsIXPConnect.idl | 7 - js/xpconnect/src/Sandbox.cpp | 124 +++++++++++++- js/xpconnect/src/XPCJSRuntime.cpp | 21 +-- js/xpconnect/src/XPCShellImpl.cpp | 2 +- js/xpconnect/src/XPCWrappedNativeScope.cpp | 26 --- js/xpconnect/src/nsXPConnect.cpp | 91 ++-------- js/xpconnect/src/xpc.msg | 1 - js/xpconnect/src/xpcprivate.h | 19 +-- js/xpconnect/src/xpcpublic.h | 27 --- .../chrome/{bug503926.xul => bug503926.xhtml} | 0 js/xpconnect/tests/chrome/chrome.ini | 147 ++++++++-------- js/xpconnect/tests/chrome/file_bug1050049.xml | 10 -- ...ile_bug618176.xul => file_bug618176.xhtml} | 0 ...t_APIExposer.xul => test_APIExposer.xhtml} | 0 ...t_bug1041626.xul => test_bug1041626.xhtml} | 0 ...t_bug1042436.xul => test_bug1042436.xhtml} | 0 .../tests/chrome/test_bug1050049.html | 56 ------- ...t_bug1092477.xul => test_bug1092477.xhtml} | 0 ...t_bug1281071.xul => test_bug1281071.xhtml} | 0 ...t_bug1390159.xul => test_bug1390159.xhtml} | 0 ...est_bug361111.xul => test_bug361111.xhtml} | 0 ...est_bug448587.xul => test_bug448587.xhtml} | 2 +- ...est_bug484459.xul => test_bug484459.xhtml} | 2 +- ...est_bug500931.xul => test_bug500931.xhtml} | 0 ...est_bug503926.xul => test_bug503926.xhtml} | 4 +- ...est_bug533596.xul => test_bug533596.xhtml} | 0 ...est_bug571849.xul => test_bug571849.xhtml} | 0 ...est_bug596580.xul => test_bug596580.xhtml} | 0 ...est_bug610390.xul => test_bug610390.xhtml} | 0 ...est_bug614757.xul => test_bug614757.xhtml} | 0 ...est_bug616992.xul => test_bug616992.xhtml} | 0 ...est_bug618176.xul => test_bug618176.xhtml} | 2 +- ...est_bug654370.xul => test_bug654370.xhtml} | 0 ...est_bug658560.xul => test_bug658560.xhtml} | 0 ...est_bug658909.xul => test_bug658909.xhtml} | 0 ...est_bug664689.xul => test_bug664689.xhtml} | 0 ...est_bug679861.xul => test_bug679861.xhtml} | 0 ...est_bug706301.xul => test_bug706301.xhtml} | 0 ...est_bug720619.xul => test_bug720619.xhtml} | 0 ...est_bug726949.xul => test_bug726949.xhtml} | 0 ...est_bug732665.xul => test_bug732665.xhtml} | 0 ...est_bug738244.xul => test_bug738244.xhtml} | 0 ...est_bug743843.xul => test_bug743843.xhtml} | 0 ...est_bug760076.xul => test_bug760076.xhtml} | 0 ...est_bug763343.xul => test_bug763343.xhtml} | 0 ...est_bug771429.xul => test_bug771429.xhtml} | 0 ...est_bug773962.xul => test_bug773962.xhtml} | 0 ...est_bug792280.xul => test_bug792280.xhtml} | 0 ...est_bug793433.xul => test_bug793433.xhtml} | 0 ...est_bug795275.xul => test_bug795275.xhtml} | 5 +- ...est_bug799348.xul => test_bug799348.xhtml} | 0 ...est_bug801241.xul => test_bug801241.xhtml} | 0 ...est_bug812415.xul => test_bug812415.xhtml} | 0 ...est_bug853283.xul => test_bug853283.xhtml} | 0 ...est_bug853571.xul => test_bug853571.xhtml} | 0 ...est_bug858101.xul => test_bug858101.xhtml} | 0 ...est_bug860494.xul => test_bug860494.xhtml} | 0 ...est_bug865948.xul => test_bug865948.xhtml} | 0 ...est_bug866823.xul => test_bug866823.xhtml} | 0 ...est_bug895340.xul => test_bug895340.xhtml} | 0 ...est_bug932906.xul => test_bug932906.xhtml} | 0 ...est_bug996069.xul => test_bug996069.xhtml} | 0 ...toSource.xul => test_chrometoSource.xhtml} | 0 ...est_cloneInto.xul => test_cloneInto.xhtml} | 0 .../chrome/{test_cows.xul => test_cows.xhtml} | 0 ...rce.xul => test_discardSystemSource.xhtml} | 0 ...ntdomain.xul => test_documentdomain.xhtml} | 0 ...l => test_doublewrappedcompartments.xhtml} | 0 ...InSandbox.xul => test_evalInSandbox.xhtml} | 0 ...alInWindow.xul => test_evalInWindow.xhtml} | 0 ...{test_exnstack.xul => test_exnstack.xhtml} | 0 ...osharing.xul => test_expandosharing.xhtml} | 0 ...Derived.xul => test_exposeInDerived.xhtml} | 0 ....xul => test_localstorage_with_nsEp.xhtml} | 0 .../{test_matches.xul => test_matches.xhtml} | 0 ...est_nodelists.xul => test_nodelists.xhtml} | 0 ...est_precisegc.xul => test_precisegc.xhtml} | 0 ...boxImport.xul => test_sandboxImport.xhtml} | 0 ...Settings.xul => test_scriptSettings.xhtml} | 0 ....xul => test_weakmap_keys_preserved.xhtml} | 0 ...xul => test_weakmap_keys_preserved2.xhtml} | 6 +- .../{test_weakref.xul => test_weakref.xhtml} | 0 ...{test_wrappers.xul => test_wrappers.xhtml} | 8 - ...{test_xrayToJS.xul => test_xrayToJS.xhtml} | 0 .../{test_xrayic.xul => test_xrayic.xhtml} | 0 .../tests/mochitest/file_bug795275.html | 14 -- .../tests/mochitest/file_bug795275.xml | 19 --- js/xpconnect/tests/mochitest/mochitest.ini | 1 - .../tests/mochitest/test_bug912322.html | 8 - .../tests/unit/test_structuredClone.js | 25 +++ js/xpconnect/tests/unit/xpcshell.ini | 1 + js/xpconnect/wrappers/WrapperFactory.cpp | 10 -- 152 files changed, 304 insertions(+), 992 deletions(-) delete mode 100644 js/src/jit-test/tests/basic/bug1405820.js delete mode 100644 js/src/jit-test/tests/basic/bug1412654.js delete mode 100644 js/src/jit-test/tests/basic/bug751139.js delete mode 100644 js/src/jit-test/tests/basic/function-cloning-1.js delete mode 100644 js/src/jit-test/tests/binast/lazy/auto-regress/bug677977.binjs delete mode 100644 js/src/jit-test/tests/binast/lazy/basic/bug1405820.binjs delete mode 100644 js/src/jit-test/tests/binast/lazy/basic/bug1405820.dir delete mode 100644 js/src/jit-test/tests/binast/lazy/basic/bug751139.binjs delete mode 100644 js/src/jit-test/tests/binast/lazy/basic/function-cloning-1.binjs delete mode 100644 js/src/jit-test/tests/binast/lazy/basic/testLet.binjs delete mode 100644 js/src/jit-test/tests/binast/lazy/basic/testScriptCloning.binjs delete mode 100644 js/src/jit-test/tests/binast/lazy/basic/weird-scopechains.binjs delete mode 100644 js/src/jit-test/tests/binast/lazy/debug/Source-invisible.binjs delete mode 100644 js/src/jit-test/tests/binast/lazy/debug/bug1406437.binjs delete mode 100644 js/src/jit-test/tests/binast/lazy/debug/onNewScript-01.binjs delete mode 100644 js/src/jit-test/tests/binast/lazy/debug/onNewScript-02.binjs delete mode 100644 js/src/jit-test/tests/binast/lazy/gc/bug-1161968.binjs delete mode 100644 js/src/jit-test/tests/binast/lazy/gc/bug-1161968.dir delete mode 100644 js/src/jit-test/tests/binast/nonlazy/auto-regress/bug677977.binjs delete mode 100644 js/src/jit-test/tests/binast/nonlazy/basic/bug1405820.binjs delete mode 100644 js/src/jit-test/tests/binast/nonlazy/basic/bug1405820.dir delete mode 100644 js/src/jit-test/tests/binast/nonlazy/basic/bug751139.binjs delete mode 100644 js/src/jit-test/tests/binast/nonlazy/basic/function-cloning-1.binjs delete mode 100644 js/src/jit-test/tests/binast/nonlazy/basic/testLet.binjs delete mode 100644 js/src/jit-test/tests/binast/nonlazy/basic/testScriptCloning.binjs delete mode 100644 js/src/jit-test/tests/binast/nonlazy/basic/weird-scopechains.binjs delete mode 100644 js/src/jit-test/tests/binast/nonlazy/debug/Source-invisible.binjs delete mode 100644 js/src/jit-test/tests/binast/nonlazy/debug/bug1406437.binjs delete mode 100644 js/src/jit-test/tests/binast/nonlazy/debug/onNewScript-01.binjs delete mode 100644 js/src/jit-test/tests/binast/nonlazy/debug/onNewScript-02.binjs delete mode 100644 js/src/jit-test/tests/binast/nonlazy/gc/bug-1161968.binjs delete mode 100644 js/src/jit-test/tests/binast/nonlazy/gc/bug-1161968.dir delete mode 100644 js/src/jsapi-tests/testCloneScript.cpp delete mode 100644 js/src/tests/non262/regress/regress-127557.js delete mode 100644 js/xpconnect/crashtests/471366-1.html rename js/xpconnect/tests/chrome/{bug503926.xul => bug503926.xhtml} (100%) delete mode 100644 js/xpconnect/tests/chrome/file_bug1050049.xml rename js/xpconnect/tests/chrome/{file_bug618176.xul => file_bug618176.xhtml} (100%) rename js/xpconnect/tests/chrome/{test_APIExposer.xul => test_APIExposer.xhtml} (100%) rename js/xpconnect/tests/chrome/{test_bug1041626.xul => test_bug1041626.xhtml} (100%) rename js/xpconnect/tests/chrome/{test_bug1042436.xul => test_bug1042436.xhtml} (100%) delete mode 100644 js/xpconnect/tests/chrome/test_bug1050049.html rename js/xpconnect/tests/chrome/{test_bug1092477.xul => test_bug1092477.xhtml} (100%) rename js/xpconnect/tests/chrome/{test_bug1281071.xul => test_bug1281071.xhtml} (100%) rename js/xpconnect/tests/chrome/{test_bug1390159.xul => test_bug1390159.xhtml} (100%) rename js/xpconnect/tests/chrome/{test_bug361111.xul => test_bug361111.xhtml} (100%) rename js/xpconnect/tests/chrome/{test_bug448587.xul => test_bug448587.xhtml} (94%) rename js/xpconnect/tests/chrome/{test_bug484459.xul => test_bug484459.xhtml} (97%) rename js/xpconnect/tests/chrome/{test_bug500931.xul => test_bug500931.xhtml} (100%) rename js/xpconnect/tests/chrome/{test_bug503926.xul => test_bug503926.xhtml} (95%) rename js/xpconnect/tests/chrome/{test_bug533596.xul => test_bug533596.xhtml} (100%) rename js/xpconnect/tests/chrome/{test_bug571849.xul => test_bug571849.xhtml} (100%) rename js/xpconnect/tests/chrome/{test_bug596580.xul => test_bug596580.xhtml} (100%) rename js/xpconnect/tests/chrome/{test_bug610390.xul => test_bug610390.xhtml} (100%) rename js/xpconnect/tests/chrome/{test_bug614757.xul => test_bug614757.xhtml} (100%) rename js/xpconnect/tests/chrome/{test_bug616992.xul => test_bug616992.xhtml} (100%) rename js/xpconnect/tests/chrome/{test_bug618176.xul => test_bug618176.xhtml} (94%) rename js/xpconnect/tests/chrome/{test_bug654370.xul => test_bug654370.xhtml} (100%) rename js/xpconnect/tests/chrome/{test_bug658560.xul => test_bug658560.xhtml} (100%) rename js/xpconnect/tests/chrome/{test_bug658909.xul => test_bug658909.xhtml} (100%) rename js/xpconnect/tests/chrome/{test_bug664689.xul => test_bug664689.xhtml} (100%) rename js/xpconnect/tests/chrome/{test_bug679861.xul => test_bug679861.xhtml} (100%) rename js/xpconnect/tests/chrome/{test_bug706301.xul => test_bug706301.xhtml} (100%) rename js/xpconnect/tests/chrome/{test_bug720619.xul => test_bug720619.xhtml} (100%) rename js/xpconnect/tests/chrome/{test_bug726949.xul => test_bug726949.xhtml} (100%) rename js/xpconnect/tests/chrome/{test_bug732665.xul => test_bug732665.xhtml} (100%) rename js/xpconnect/tests/chrome/{test_bug738244.xul => test_bug738244.xhtml} (100%) rename js/xpconnect/tests/chrome/{test_bug743843.xul => test_bug743843.xhtml} (100%) rename js/xpconnect/tests/chrome/{test_bug760076.xul => test_bug760076.xhtml} (100%) rename js/xpconnect/tests/chrome/{test_bug763343.xul => test_bug763343.xhtml} (100%) rename js/xpconnect/tests/chrome/{test_bug771429.xul => test_bug771429.xhtml} (100%) rename js/xpconnect/tests/chrome/{test_bug773962.xul => test_bug773962.xhtml} (100%) rename js/xpconnect/tests/chrome/{test_bug792280.xul => test_bug792280.xhtml} (100%) rename js/xpconnect/tests/chrome/{test_bug793433.xul => test_bug793433.xhtml} (100%) rename js/xpconnect/tests/chrome/{test_bug795275.xul => test_bug795275.xhtml} (94%) rename js/xpconnect/tests/chrome/{test_bug799348.xul => test_bug799348.xhtml} (100%) rename js/xpconnect/tests/chrome/{test_bug801241.xul => test_bug801241.xhtml} (100%) rename js/xpconnect/tests/chrome/{test_bug812415.xul => test_bug812415.xhtml} (100%) rename js/xpconnect/tests/chrome/{test_bug853283.xul => test_bug853283.xhtml} (100%) rename js/xpconnect/tests/chrome/{test_bug853571.xul => test_bug853571.xhtml} (100%) rename js/xpconnect/tests/chrome/{test_bug858101.xul => test_bug858101.xhtml} (100%) rename js/xpconnect/tests/chrome/{test_bug860494.xul => test_bug860494.xhtml} (100%) rename js/xpconnect/tests/chrome/{test_bug865948.xul => test_bug865948.xhtml} (100%) rename js/xpconnect/tests/chrome/{test_bug866823.xul => test_bug866823.xhtml} (100%) rename js/xpconnect/tests/chrome/{test_bug895340.xul => test_bug895340.xhtml} (100%) rename js/xpconnect/tests/chrome/{test_bug932906.xul => test_bug932906.xhtml} (100%) rename js/xpconnect/tests/chrome/{test_bug996069.xul => test_bug996069.xhtml} (100%) rename js/xpconnect/tests/chrome/{test_chrometoSource.xul => test_chrometoSource.xhtml} (100%) rename js/xpconnect/tests/chrome/{test_cloneInto.xul => test_cloneInto.xhtml} (100%) rename js/xpconnect/tests/chrome/{test_cows.xul => test_cows.xhtml} (100%) rename js/xpconnect/tests/chrome/{test_discardSystemSource.xul => test_discardSystemSource.xhtml} (100%) rename js/xpconnect/tests/chrome/{test_documentdomain.xul => test_documentdomain.xhtml} (100%) rename js/xpconnect/tests/chrome/{test_doublewrappedcompartments.xul => test_doublewrappedcompartments.xhtml} (100%) rename js/xpconnect/tests/chrome/{test_evalInSandbox.xul => test_evalInSandbox.xhtml} (100%) rename js/xpconnect/tests/chrome/{test_evalInWindow.xul => test_evalInWindow.xhtml} (100%) rename js/xpconnect/tests/chrome/{test_exnstack.xul => test_exnstack.xhtml} (100%) rename js/xpconnect/tests/chrome/{test_expandosharing.xul => test_expandosharing.xhtml} (100%) rename js/xpconnect/tests/chrome/{test_exposeInDerived.xul => test_exposeInDerived.xhtml} (100%) rename js/xpconnect/tests/chrome/{test_localstorage_with_nsEp.xul => test_localstorage_with_nsEp.xhtml} (100%) rename js/xpconnect/tests/chrome/{test_matches.xul => test_matches.xhtml} (100%) rename js/xpconnect/tests/chrome/{test_nodelists.xul => test_nodelists.xhtml} (100%) rename js/xpconnect/tests/chrome/{test_precisegc.xul => test_precisegc.xhtml} (100%) rename js/xpconnect/tests/chrome/{test_sandboxImport.xul => test_sandboxImport.xhtml} (100%) rename js/xpconnect/tests/chrome/{test_scriptSettings.xul => test_scriptSettings.xhtml} (100%) rename js/xpconnect/tests/chrome/{test_weakmap_keys_preserved.xul => test_weakmap_keys_preserved.xhtml} (100%) rename js/xpconnect/tests/chrome/{test_weakmap_keys_preserved2.xul => test_weakmap_keys_preserved2.xhtml} (92%) rename js/xpconnect/tests/chrome/{test_weakref.xul => test_weakref.xhtml} (100%) rename js/xpconnect/tests/chrome/{test_wrappers.xul => test_wrappers.xhtml} (93%) rename js/xpconnect/tests/chrome/{test_xrayToJS.xul => test_xrayToJS.xhtml} (100%) rename js/xpconnect/tests/chrome/{test_xrayic.xul => test_xrayic.xhtml} (100%) delete mode 100644 js/xpconnect/tests/mochitest/file_bug795275.xml create mode 100644 js/xpconnect/tests/unit/test_structuredClone.js diff --git a/js/public/Transcoding.h b/js/public/Transcoding.h index ef38ae256a..efbef01455 100644 --- a/js/public/Transcoding.h +++ b/js/public/Transcoding.h @@ -19,7 +19,6 @@ #include "js/RootingAPI.h" // JS::Handle, JS::MutableHandle struct JS_PUBLIC_API JSContext; -class JS_PUBLIC_API JSFunction; class JS_PUBLIC_API JSObject; class JS_PUBLIC_API JSScript; @@ -102,9 +101,6 @@ extern JS_PUBLIC_API TranscodeResult EncodeScript(JSContext* cx, TranscodeBuffer& buffer, Handle script); -extern JS_PUBLIC_API TranscodeResult EncodeInterpretedFunction( - JSContext* cx, TranscodeBuffer& buffer, Handle funobj); - // Decode JSScript from the buffer. // // The start of `buffer` and `cursorIndex` should meet @@ -124,11 +120,6 @@ extern JS_PUBLIC_API TranscodeResult DecodeScript(JSContext* cx, const ReadOnlyCompileOptions& options, const TranscodeRange& range, MutableHandle scriptp); -extern JS_PUBLIC_API TranscodeResult DecodeInterpretedFunction( - JSContext* cx, const ReadOnlyCompileOptions& options, - TranscodeBuffer& buffer, MutableHandle funp, - size_t cursorIndex = 0); - // If js::UseOffThreadParseGlobal is true, decode JSScript from the buffer. // // If js::UseOffThreadParseGlobal is false, decode CompilationStencil from the diff --git a/js/public/friend/ErrorNumbers.msg b/js/public/friend/ErrorNumbers.msg index 801385cb80..2dcd5c315c 100644 --- a/js/public/friend/ErrorNumbers.msg +++ b/js/public/friend/ErrorNumbers.msg @@ -183,7 +183,6 @@ MSG_DEF(JSMSG_OBJECT_ACCESS_DENIED, 0, JSEXN_ERR, "Permission denied to acces MSG_DEF(JSMSG_PROPERTY_ACCESS_DENIED, 1, JSEXN_ERR, "Permission denied to access property {0}") // JSAPI-only (Not thrown as JS exceptions) -MSG_DEF(JSMSG_BAD_CLONE_FUNOBJ_SCOPE, 0, JSEXN_TYPEERR, "bad cloned function scope chain") MSG_DEF(JSMSG_CANT_CLONE_OBJECT, 0, JSEXN_TYPEERR, "can't clone object") MSG_DEF(JSMSG_CANT_OPEN, 2, JSEXN_ERR, "can't open {0}: {1}") MSG_DEF(JSMSG_SUPPORT_NOT_ENABLED, 1, JSEXN_ERR, "support for {0} is not enabled") diff --git a/js/src/builtin/TestingFunctions.cpp b/js/src/builtin/TestingFunctions.cpp index e8f42b06c3..fc8c0efc24 100644 --- a/js/src/builtin/TestingFunctions.cpp +++ b/js/src/builtin/TestingFunctions.cpp @@ -4724,7 +4724,6 @@ static bool ShellCloneAndExecuteScript(JSContext* cx, unsigned argc, JS::CompileOptions options(cx); options.setFileAndLine(filename.get(), lineno); - options.setNoScriptRval(true); JS::SourceText srcBuf; if (!srcBuf.init(cx, src, srclen, SourceOwnership::Borrowed)) { @@ -4746,14 +4745,19 @@ static bool ShellCloneAndExecuteScript(JSContext* cx, unsigned argc, return false; } - AutoRealm ar(cx, global); - JS::RootedValue rval(cx); - if (!JS::CloneAndExecuteScript(cx, script, &rval)) { + { + AutoRealm ar(cx, global); + if (!JS::CloneAndExecuteScript(cx, script, &rval)) { + return false; + } + } + + if (!cx->compartment()->wrap(cx, &rval)) { return false; } - args.rval().setUndefined(); + args.rval().set(rval); return true; } diff --git a/js/src/jit-test/tests/asm.js/bug1542130.js b/js/src/jit-test/tests/asm.js/bug1542130.js index bab11b8de3..9b809bab69 100644 --- a/js/src/jit-test/tests/asm.js/bug1542130.js +++ b/js/src/jit-test/tests/asm.js/bug1542130.js @@ -1,6 +1,6 @@ // |jit-test| error:AsmJS modules do not yet support cloning; skip-if: !isAsmJSCompilationAvailable() var g = newGlobal(); -g.evaluate(` +cloneAndExecuteScript(` function h() { function f() { 'use asm'; @@ -9,6 +9,4 @@ g.evaluate(` } return f; } -`); -var h = clone(g.h); -h(); +`, g); diff --git a/js/src/jit-test/tests/asm.js/testBug893519.js b/js/src/jit-test/tests/asm.js/testBug893519.js index 3b747fa6ad..cf801f62b0 100644 --- a/js/src/jit-test/tests/asm.js/testBug893519.js +++ b/js/src/jit-test/tests/asm.js/testBug893519.js @@ -1,6 +1,4 @@ -// |jit-test| error:Error; skip-if: !isAsmJSCompilationAvailable() +// |jit-test| error:Error: AsmJS modules do not yet support cloning; skip-if: !isAsmJSCompilationAvailable() var g = newGlobal({newCompartment: true}); -evaluate("function h() { function f() { 'use asm'; function g() { return 42 } return g } return f }", { global:g}); -var h = clone(g.h); -assertEq(h()()(), 42); +cloneAndExecuteScript("function h() { function f() { 'use asm'; function g() { return 42 } return g } return f }", g); diff --git a/js/src/jit-test/tests/auto-regress/bug1466626-2.js b/js/src/jit-test/tests/auto-regress/bug1466626-2.js index 62247171e2..056ea075e2 100644 --- a/js/src/jit-test/tests/auto-regress/bug1466626-2.js +++ b/js/src/jit-test/tests/auto-regress/bug1466626-2.js @@ -3,16 +3,12 @@ var globals = []; for (var i = 0; i < 24; ++i) { var g = newGlobal(); - g.eval(` - function f(){} - var env = {}; - `); globals.push(g); } var i = 0; oomTest(function() { globals[(i++) % globals.length].eval(` - this.clone(this.f, this.env); + evaluate("function f() {}", {envChainObject: this.env}); `); }); diff --git a/js/src/jit-test/tests/auto-regress/bug677977.js b/js/src/jit-test/tests/auto-regress/bug677977.js index c4211e5ccb..e2b0735613 100644 --- a/js/src/jit-test/tests/auto-regress/bug677977.js +++ b/js/src/jit-test/tests/auto-regress/bug677977.js @@ -23,4 +23,3 @@ this.gczeal(hits, 2); var fn = g.evaluate("(function (a) { return 5 + a; })"); var g2 = newGlobal({newCompartment: true}); dbg.addDebuggee(g2, dbg); -g2.clone(fn); diff --git a/js/src/jit-test/tests/basic/bug1106982-2.js b/js/src/jit-test/tests/basic/bug1106982-2.js index 378d10f514..1983c4b04f 100644 --- a/js/src/jit-test/tests/basic/bug1106982-2.js +++ b/js/src/jit-test/tests/basic/bug1106982-2.js @@ -10,11 +10,6 @@ var p = new Proxy(t, { }, get(t, id) { return t[id]; } }); -evaluate(`function testFunc() { - x += " x"; -}`); - -var cloneFunc = clone(testFunc, p); -cloneFunc(); +evaluate(`x += " x";`, {envChainObject: p}); assertEq(hits, 2); assertEq(t.x, "undefined x"); diff --git a/js/src/jit-test/tests/basic/bug1405820.js b/js/src/jit-test/tests/basic/bug1405820.js deleted file mode 100644 index 58594d77a5..0000000000 --- a/js/src/jit-test/tests/basic/bug1405820.js +++ /dev/null @@ -1,5 +0,0 @@ -// |jit-test| error: Error - -var g = newGlobal(); -g.f = setJitCompilerOption; -g.eval("clone(f)()(9)") diff --git a/js/src/jit-test/tests/basic/bug1412654.js b/js/src/jit-test/tests/basic/bug1412654.js deleted file mode 100644 index d3b96a73ad..0000000000 --- a/js/src/jit-test/tests/basic/bug1412654.js +++ /dev/null @@ -1,4 +0,0 @@ -// |jit-test| error: can't clone -var gv = newGlobal(); -gv.f = (class get {}); -gv.eval('f = clone(f);'); diff --git a/js/src/jit-test/tests/basic/bug751139.js b/js/src/jit-test/tests/basic/bug751139.js deleted file mode 100644 index a889ab6239..0000000000 --- a/js/src/jit-test/tests/basic/bug751139.js +++ /dev/null @@ -1,7 +0,0 @@ - -load(libdir + "asserts.js"); - -function C(a, b) {} -var f = C.bind(null, 2); -var that = this; -assertThrowsInstanceOf(function () { g = clone(f, that)}, TypeError); diff --git a/js/src/jit-test/tests/basic/function-cloning-1.js b/js/src/jit-test/tests/basic/function-cloning-1.js deleted file mode 100644 index 92511b15bd..0000000000 --- a/js/src/jit-test/tests/basic/function-cloning-1.js +++ /dev/null @@ -1,4 +0,0 @@ -var g = newGlobal(); -var f1 = g.evaluate("(function (x) { function inner() {}; })"); -gczeal(2, 1); // Exercise all the edge cases in cloning, please. -var f2 = clone(f1); diff --git a/js/src/jit-test/tests/basic/testLet.js b/js/src/jit-test/tests/basic/testLet.js index 9ffc062b0a..4edec77ce7 100644 --- a/js/src/jit-test/tests/basic/testLet.js +++ b/js/src/jit-test/tests/basic/testLet.js @@ -19,9 +19,9 @@ function test(str, arg, result) // test reflection logic Reflect.parse(got); - // test xdr by cloning a cross-compartment function + // test script cloning var code = "(function (x) { " + str + " })"; - var c = clone(otherGlobal.evaluate(code)); + var c = cloneAndExecuteScript(code, otherGlobal); assertEq(c.toString(), eval(code).toString()); var got = fun(arg); diff --git a/js/src/jit-test/tests/basic/testScriptCloning.js b/js/src/jit-test/tests/basic/testScriptCloning.js index 4099acfb96..2d9eaccd49 100644 --- a/js/src/jit-test/tests/basic/testScriptCloning.js +++ b/js/src/jit-test/tests/basic/testScriptCloning.js @@ -1,21 +1,22 @@ var g = newGlobal(); -g.f = new Function('return function(x) { return x };'); -assertEq(g.eval("clone(f)()(9)"), 9); +var f; +f = cloneAndExecuteScript('(function(x) { return x })', g); +assertEq(f(9), 9); -g.f = new Function('return function(x) { { let y = x+1; return y } };'); -assertEq(g.eval("clone(f)()(9)"), 10); +f = cloneAndExecuteScript('(function(x) { { let y = x+1; return y } })', g); +assertEq(f(9), 10); -g.f = new Function('return function(x) { { let y = x, z = 1; return y+z } };'); -assertEq(g.eval("clone(f)()(9)"), 10); +f = cloneAndExecuteScript('(function(x) { { let y = x, z = 1; return y+z } })', g); +assertEq(f(9), 10); -g.f = new Function('return function(x) { return x.search(/ponies/) };'); -assertEq(g.eval("clone(f)()('123ponies')"), 3); +f = cloneAndExecuteScript('(function(x) { return x.search(/ponies/) })', g); +assertEq(f('123ponies'), 3); -g.f = new Function('return function(x,y) { return x.search(/a/) + y.search(/b/) };'); -assertEq(g.eval("clone(f)()('12a','foo')"), 1); +f = cloneAndExecuteScript('(function(x, y) { return x.search(/a/) + y.search(/b/) })', g); +assertEq(f('12a','foo'), 1); -g.f = new Function('return function(x) { switch(x) { case "a": return "b"; case null: return "c" } };'); -assertEq(g.eval("clone(f)()('a')"), "b"); -assertEq(g.eval("clone(f)()(null)"), "c"); -assertEq(g.eval("clone(f)()(3)"), undefined); +f = cloneAndExecuteScript('(function(x) { switch(x) { case "a": return "b"; case null: return "c" } })', g); +assertEq(f('a'), "b"); +assertEq(f(null), "c"); +assertEq(f(3), undefined); diff --git a/js/src/jit-test/tests/basic/weird-scopechains.js b/js/src/jit-test/tests/basic/weird-scopechains.js index 035a934ec5..c992f315bb 100644 --- a/js/src/jit-test/tests/basic/weird-scopechains.js +++ b/js/src/jit-test/tests/basic/weird-scopechains.js @@ -6,20 +6,6 @@ function assertWithMessage(got, expected, message) { assertEq(message + ": " + got, message + ": " + expected); } -function testFunc() { - assertWithMessage(checkNameLookup(), "local", "nameLookup"); - assertWithMessage(checkThisBinding(), "local", "thisBinding"); - - // Important: lambda needs to close over "reason", so it won't just get the - // scope of testFunc as its scope. Instead it'll get the Call object - // "reason" lives in. - var reason = " in lambda in Call"; - (function() { - assertWithMessage(checkNameLookup(), "local", "nameLookup" + reason); - assertWithMessage(checkThisBinding(), "local", "thisBinding" + reason); - })(); -} - var obj = { checkNameLookup: function() { return "local"; @@ -30,5 +16,16 @@ var obj = { }, }; -var cloneFunc = clone(testFunc, obj); -cloneFunc(); +evaluate("(" + function() { + assertWithMessage(checkNameLookup(), "local", "nameLookup"); + assertWithMessage(checkThisBinding(), "local", "thisBinding"); + + // Important: lambda needs to close over "reason", so it won't just get the + // scope of testFunc as its scope. Instead it'll get the Call object + // "reason" lives in. + var reason = " in lambda in Call"; + (function() { + assertWithMessage(checkNameLookup(), "local", "nameLookup" + reason); + assertWithMessage(checkThisBinding(), "local", "thisBinding" + reason); + })(); +} + ")()", {envChainObject: obj}); diff --git a/js/src/jit-test/tests/binast/lazy/auto-regress/bug677977.binjs b/js/src/jit-test/tests/binast/lazy/auto-regress/bug677977.binjs deleted file mode 100644 index 0480f2b341963391cb2f5ecea104be3cffba5a79..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1297 zcmZWo?`zsX7``4sju46jks?w;DK=IS=UkE6b@qoX9n}_f`%?DdOwRO1%(=_i&X)ek z`yY0f7?X7gA$i|>-sgGV_b%r*!>?oba6LL349-SBs7nGt#j5)Uo!U21Fr$R`e=j%* zL&}2k1@`?k+&ia%O9L;3R?@|>z=F&rVdItx!m&RVTw+r|T_LD5AoFQf!#)c`!Ub_J ziQ{8V+##Nm%6H5up86zC$~qS8zt1raEa?dIRYoLXyT@GeNF!s1Ey(F6%|fcku)hH) zJu6w48c~6D#rQk}3Y+V$hRZqO)JYYUf9eIQ^EA10i3PsrQkjcY`)V0DN;F-+V1bYY zVf_}rto~n4#LgM>3C`42)-Dq2$ot*&Cvh_3o$R1fcN5G#B3enOV~5j)xc1ppZk3u* z`#m(>=4N8?jt_`($~!EO}skvT7FYT5r|-C7CWgkMJUP<qD#4)jK{7NK;0A&Kb9>4He5{B>#f0USUCE zWb*?RSuiBe@dS<7w-H9WrPXQ=lTp8)&g)g{Gz|j+VC3bafh_~cw=UlWAg|IkfO$=W zU-CKg%o zHuKIr?|iJIU7YcJo34^%m409a%Ah$upF0ab`biE56n?b?U58p-Z-kUKUD_}+!ay_N z{;KPM3{)>rN%q3C&y1IrrQ%_uhy3@=Ju)v({Ac~aeWE8a2f#Oo+t&6l&toyngY z?APq6O)(0*dCDM+~#6m3J! zl8h;zOOl}v>v%Ptx<>C%|H|_bfRCZ(dr$)i0u0yarUh5Mi#q^>Fbr=Y#C7nYjsk#M z10x>=-UR?O0bL@D2Y?#5dvAf_`+P*bp*5=G4uA(RY6FBtDHLTWxNcoyXkx&Y4F3Yc C3kb6S diff --git a/js/src/jit-test/tests/binast/lazy/basic/function-cloning-1.binjs b/js/src/jit-test/tests/binast/lazy/basic/function-cloning-1.binjs deleted file mode 100644 index dd5fcf7e581d8385e0124e63c363dbb8f3adc824..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 463 zcmZ8d%Sr<=6b&H^r3|GM5f?57kun7l?Y0YTwUiM%i%D@)T%?&hC6LLKO!`pikN64x zm4DzTm}#pKF9hy6oO{o?8AR~|#nVyJACLRVvq(W1VP1Nl_#}*WAQPa6n}vq56oopy zV^TU8_RA8qf%G1@WE#?#<#09-Divz(=G#w93pSImmoZ~Eo&Vic5WkYxx;->sH#?DsQ5_@v E4Ko>%kN^Mx diff --git a/js/src/jit-test/tests/binast/lazy/basic/testLet.binjs b/js/src/jit-test/tests/binast/lazy/basic/testLet.binjs deleted file mode 100644 index e6419d438c0b2e1705a33ec5d0deb70f58b0fcf2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8796 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 AivR!s diff --git a/js/src/jit-test/tests/binast/lazy/basic/testScriptCloning.binjs b/js/src/jit-test/tests/binast/lazy/basic/testScriptCloning.binjs deleted file mode 100644 index b9c0aa530642f7d7fe8bece8e82c70006e2dcd50..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1114 zcmaiyQH$C@6orQ&h%B;*EXyJyLlBcxal5-OZKZVG){3S2V5Be7he>i{2jav|##MK_ zf2RMgPwh|W7?KWBveUo}OrTRPdBf{5l`o>mDREeC zJ6{Ws3&BaaTgYBHpd(o_slYVerwI^~ny>ah zGCi|RQgyRlCi^CN`0Eb$Bmzm+gYV9LmX2_b|ngi^{rY%u7Lv~)CWiOcq(?1N%!iCWvrWMwq_ zOZVsOFYnz?gX=2zCAb>DEEO+H zA&d4o%Q72|ZiMEFWwBPGm|GmWXQD_EvKoEM#+qrKW2eDsS#qU$dcl*7DW2Z4oDXa8 zo+%7bKThP5M>YJNZ2@e-)Y{5Mmr~^{+m)4H>ymp}3XSgfNYm-$a#bV-w;JcN&}ghY zs;N6Q;d&v{ni$=%zw4UZ*k(qeGv#`virr{^v?ewbe0Ud47pax!rKFx6$%6aEl-F~JqV-koH@lV@Y{M#|^al6>?snXs&pZ+KsE zR>~r((oC1_ssu?U3vP@z`O6Zm^3<72?a0|vQ}a?AhJKD(#ZEcYwz?OIBFb1kOPTpI zYuemc8~^qyWq)2>(&NK)Jho%3=+OtyCvf0XJWT*U#B&Jv`E3A~0z~hi0dUX)2Wirw zeS;GRmWVqcv>+q_gw!)Rj@xnr*Q+u;0$mz7fdd|W2d&*-VCu2MKdVc89}d993gQr; zKwaA21`QK*A|PGYr;$g701g0_TTgVaE^ufY{JmNPI^aVk5RPbXK>L+K_mu>W<@N@R X4K;W}k>eA(5oi+VQEVP!gC_h3^YAdx diff --git a/js/src/jit-test/tests/binast/lazy/debug/Source-invisible.binjs b/js/src/jit-test/tests/binast/lazy/debug/Source-invisible.binjs deleted file mode 100644 index be8698fc8fb46be62ca535775ce3e8c3ef7c8ac5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 712 zcmZ8dQETEr5RS_dLI@>@h=@oK5evsr?&+Z1gH{obQx7A3kv?pa$+E|~E1Na8l>WT_ zuWn*x%PlO-%=gWFGv9Q%{vD(JVmn!_Cfg^LfzV99+`r@Dcv&Yo12um>Dkusj#kW`! z&C(SdlCS071L54V#*?A|r6HR^%87z(O%5=aGLbPs?bwm+sK&ysqLVkF^kX*FU} z4F9i5)tM1Z{wjGiGB0<3m+b-9O*t)(!L$@Rf(-KqW zW(h^POUttdCE+~*=LdN>5~VBQrb#a=g)>M_l!9uL%otwB(9NS?QOc!&aejN>&rc$) zoQ(4EZS?wfXVf=makXUzMSY@FBPL2#Fk}BtUdIL(Fev0nrQn-YPO#r?=X1Mv14UiW zbsfjW<|Ffc$Gk9b(2a+&6QT|dTQ|){*y=SKK1L1>P`gvZsD@Du`@MmKJcD`_2N_Pg a=D2;Q>C{nGcUuPY5ke;RyQu9A`q2l{Oy8OS diff --git a/js/src/jit-test/tests/binast/lazy/debug/bug1406437.binjs b/js/src/jit-test/tests/binast/lazy/debug/bug1406437.binjs deleted file mode 100644 index 0531757f60b211c453d215bf156f1f4c7f89b6a3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 759 zcmZWm-D=w~6jp^X!I%<42_cwbN(tErC5&AR$}aNPkkOh0S0%I_LY-(Qvl-64CW^IhfA}%WpgdX}CGw|8o1?S$WuS(32lK4SCL$ z>_vtdp3GqzpSOb%6T+gpgFFXqARR*@n1*!0ws14#GUYO}vK`APWMPZuov%!D77I90 z(M-wPe|t)kyGL$7GZ7h$npUV+SwAz4rih6WwSx~;J4!U)nW<1Qa*Ih=P0*xl6ybR$ zi!fHUHD-oAYs71F3?G!|1JJdDFN(^*LfRM zUd86x3piNi@G1Td$yql4bf-_}Ph;<}Vmbq}j#kUrVj9^O{&VfVFikTzjWZ|B=%zk~ zc%NmUn=HkLD{H913lr^4_&H33lF;3}yYHji(?M1N$B>sRRXUJx7^&@!X;Un(fydLH z{S(5^)m|syq2eCatL0>3)BNr=UDqMRb@8VJKi?MaC&4n;I=)Ju}nB_1g&7yFKnGmlb=wcDVLTF`300+KHKy8r+H diff --git a/js/src/jit-test/tests/binast/lazy/debug/onNewScript-01.binjs b/js/src/jit-test/tests/binast/lazy/debug/onNewScript-01.binjs deleted file mode 100644 index 541b83c14c4d204cc5b8dafaf71c58b5ab58c35a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1435 zcmaJV0&FgmRb9_J3&yrSotz zatUjHnJ^Lru1||e*yos&v8XQ`W6w+S+ZQe;413+_m@wB)4l1(4wL4@yScEJc31o*# zq@=c*%*6&TY~!O zl-iOzK|b~=7bXOi3;cEV^tc!e6hq1(t#^Y@#9r{NvFNc-6d61BaP^vEHcJQ(W676( z;7TnE0wsDaKJVMio$xcyA7F1jthj?mQ28!-NPvxbgLOR_iZ_zvZ~9lg^X^$cd1ud+ zmUip%K)uJz#NjozKO;vS4jg4fQJ^?AEg*!NCuA^n9Ktkmk3CcVrUJS^$-}Wfo?yo1 z`^kvyT;*YD6!}}io7Ojr5k6(qdSz`{c;EWIsnwJ|8&$h(-+vFAEiT>fDMevdKhx{Koh1&b2X6Ezh(@%`i0trY@E$R$44TDbqwLfcgqT*|e%a9+i<*%H>jF zLQ^1vKn-Ja7m5%@phEN^y#iXT2%-&stOFF#HW&b@HIz2;s{k5OKvC*VFf_=l=ThOe zx~FJhZX+;cLWH|Y81BJ=0U=^TA_DA5M2Q9x3nATr>fxNb@v|wni4e&nu!PjiYLqpb zAsxh3zhD2er5d%YEVaNgi(ts2jP+mO&?8-nSyM8lO#Ml5s1&>&qwfZt*%gcktN8V|Xf+S3-$;DCgy5i608Cyqi|pjL4cT!F%%5^=&vbRr|$b zD(RJgk&weuRL8gClF3`Y9TmBlEOH|G?6^`9fikvKXJ6tp$Xol4wGzc$X)xIr-lT`p zBTM96uMJ%lZ@g(%Z996vn3thpgVp}V zoy;+_`;Nl|&esWieEW{)AgT{d`G#=QqE9EOu#cLO@KOU?_04y^1Nejh5?s46}?%p${3CJH8+${`T2aCUchcT2Cm{6@tKM*t{nSR1*@XrS<3VI!9V<*Nxx%?uR9 z%YMK}0C%<}Usj270`VyzoAS?<=P^~B6xd4e@E71Un}r0%UjLnF_S}9jMKrZCFoy{mb?8Iz z0N-{5TPJ~IhG!6;*>0)Icf6`PEi&ZHZ4(Y#v|Ac1d+f`R-|bN$)$3&rrlWhe;CpaI zMs2?|Zb6$A2(4-Xlk3o-wC~))m1(h_y7+H=|FcvLGHT(k@IoPjWdEw>va9 zEFg@|aRryQ-z?9Bfiy<*7@=@HTSlv+k*=kd)=~Om9w7~*A9Dz$v55?XW-@re&}I?R zQy67ZYkwibK=WjICY)ODv4Lh!FfvpChF7U@xR3r^)kDUHVnnE-7!?~*TsXC~s#_nj z;1Z$o&;2cg7BEJ4o1rQ|mFk>Af~{43gaasO&Z)ml3Pr*HUc(&YkxKD_3OE9|zWF?4 zCjr_1CCl1^zOC;kU{8o0J`Y)Y9&(+4Jn*xlvRcvftZwS{r(xnM_w%d9;t!x=wG5_HyZxuravTRC2b(0wM4e#NB8{>%F+3J`!y3Z% k3dX302(BVr!Oi9#GUEnncM+)?xLT6Lkc~a*oS{1U1>w-B#Q*>R diff --git a/js/src/jit-test/tests/binast/lazy/gc/bug-1161968.dir b/js/src/jit-test/tests/binast/lazy/gc/bug-1161968.dir deleted file mode 100644 index 922d49f22e..0000000000 --- a/js/src/jit-test/tests/binast/lazy/gc/bug-1161968.dir +++ /dev/null @@ -1 +0,0 @@ -// |jit-test| skip-if: !('gczeal' in this) diff --git a/js/src/jit-test/tests/binast/nonlazy/auto-regress/bug677977.binjs b/js/src/jit-test/tests/binast/nonlazy/auto-regress/bug677977.binjs deleted file mode 100644 index 4459352dc7fa8280c7035606444e3bcc41dc1892..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1296 zcmZWo|7+Sn6u%xJ93d15B1NPerPx@DIOmGguCrfk>6o@?w_nPBIFmEI5p(Wxw(Ca! z==}$~OVp%YM3VRNd7sbcy>~gg9)2Ff`>WCEU~oG6&U_k4CZD^1(TRJV1XD&u|JPj5 zIA%PmoRcuj!kse~`78=DXf=B|mPFE-B5ZtNk_r-zrBK)maG(*)8_?M#ui>7?F%^>f z7t{-hp#G4|X!RQrj7&nBCRH7ecHic>09ZL9;yEX>V!I_m@hBr>kI(7JI?ZFI$w;^c zXg$1ouQZYZe96Tu2a21^u7-;l70k;NwSN{wy7Mf#bwMP#6-rsi=SH6dR9r41Pb+7j z_W!AK9!W*CRy*T7q$F2UUD{Z2C+2S^Kd6^e@8l<)*}Eempt7}Ub?gZ?mscU5s9otH zwckRsJvU#qkXuS~)x(V#Q2D_9RR?xTU%7i=an>^aI``Ev$rAVDyV3RVYMh#nD%45SUq>ToH%w# z4gbM{%7uvV2VBRbi(hJm3p!Z@YBMF`tHYN((*j9OWB;e+g*>7~e~IZ@Wi9XSwN&~0 zy;?y>3)Kpo;s`6-M zWc>-1cr>I>=>+Z6w;dKI%S1570B3xMO*(+8&y#Ql}!kWDur4oHDhgSWBN+uJFnzl(;b78 umZj=-CKg%o zHuKIr?|iJIU7YcJo34^%m409a%Ah$upF0ab`biE56n?b?U58p-Z-kUKUD_}+!ay_N z{;KPM3{)>rN0#=&b{f{Yptc;=*#m-EnN|-!ED4!tmq73PB z4;>gY%(-zRXxpJM+&k@H!g7u;Z$(=6K8w-+hj0bMO6#DpDvS-F2Nm^-b8a>&tBCv0 z!p@Az#oPJ(2PbsPQKZhV|Cfji+Wk2^JU+iy?nR_?zD>^e-HJCtJMk)tm$St*a)@%PeCeG!ATxU zkz@jWsaQrHR`GH&agE-Q{*~tw0G~q5_n-z41Qf2xO$)Ai7i|DSD0CpCb?~810)SeB z5}yR#1pqXGToOtLKpM1rZ-Mgra6r9B>ric5WkYxx;->sH#?DsQ5_@v E4Ko>%kN^Mx diff --git a/js/src/jit-test/tests/binast/nonlazy/basic/testLet.binjs b/js/src/jit-test/tests/binast/nonlazy/basic/testLet.binjs deleted file mode 100644 index e782b5eec525acea00ae546a74fe7a7c4600a58e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8792 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 F;SW*jCfEP~ diff --git a/js/src/jit-test/tests/binast/nonlazy/debug/Source-invisible.binjs b/js/src/jit-test/tests/binast/nonlazy/debug/Source-invisible.binjs deleted file mode 100644 index be8698fc8fb46be62ca535775ce3e8c3ef7c8ac5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 712 zcmZ8dQETEr5RS_dLI@>@h=@oK5evsr?&+Z1gH{obQx7A3kv?pa$+E|~E1Na8l>WT_ zuWn*x%PlO-%=gWFGv9Q%{vD(JVmn!_Cfg^LfzV99+`r@Dcv&Yo12um>Dkusj#kW`! z&C(SdlCS071L54V#*?A|r6HR^%87z(O%5=aGLbPs?bwm+sK&ysqLVkF^kX*FU} z4F9i5)tM1Z{wjGiGB0<3m+b-9O*t)(!L$@Rf(-KqW zW(h^POUttdCE+~*=LdN>5~VBQrb#a=g)>M_l!9uL%otwB(9NS?QOc!&aejN>&rc$) zoQ(4EZS?wfXVf=makXUzMSY@FBPL2#Fk}BtUdIL(Fev0nrQn-YPO#r?=X1Mv14UiW zbsfjW<|Ffc$Gk9b(2a+&6QT|dTQ|){*y=SKK1L1>P`gvZsD@Du`@MmKJcD`_2N_Pg a=D2;Q>C{nGcUuPY5ke;RyQu9A`q2l{Oy8OS diff --git a/js/src/jit-test/tests/binast/nonlazy/debug/bug1406437.binjs b/js/src/jit-test/tests/binast/nonlazy/debug/bug1406437.binjs deleted file mode 100644 index a06c2d06f5439aa22c8e32bbf2aa835b5e2e9a9b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 759 zcmZWmO>5gg5Zx?dF+vn$f-%Mf5rT1xF{boT2tD{K#-(@# z{;&R)9y*evO0)vO?97|@-pou_o6iB=FSnERdb0f{Vo+Atm;0Y=JXjTvg8;MmaWs%+ zLaSk5xfRhG(y*TH&A5~mYB0$%Fc#uDM3NhbH#~*gsZg;{Nk!YQI&xY_QM~_^8^J>f zmsS+h>h9m1He~cgSTI}$)*xp^G%Tf`xIt0G1d%?%`!XFwMjY)@>JWSLieFYxq)6oE zMWS*u6>VqEEq^kIH}++;;0c(AlZtY8707?kCgt+4a`xeW%uFkb%-Q(W|5R%UyhhT0 zEtF#U>be^^*JK{U?-13@d6%I+)^Ae{vEwEIyAO8T)n*w~C;olIp1Gk3i^If;6MAUQ zAv`5GS)0drxgv%JJagGS_@DepY6XMC+xs!nJ)Tu*a1L3qQ*C+*&NH1Jxv}~7TKK#y z+PfgUOrJ~yE;62AzuPVrm78C~He(JUjNwlSex66@n+A1Ao4%vH{`K9J+Z_?wxFMuT r$Son)gk1Tg*+H!9Pz2Lfv*>XK#3e<&K&3W&*(>d;a_J)j0Pd*;}G7n1^dNcBv zXn&gs7KUEHi*eYORI)MF7fz_}$N8Q2o@9dh-RYPK&xsEzs>5?SY&=+mEFB}V%N0^w zTaS}hRJcsWV%A$8A9~!4GYWwT$%d!Q@u^_LE*-OKB%?0{7RSiNk5qVc;ImmVDhl|< zaxM__DOy3`Gs@$BsLa_esX!i_weJKIX3x`zr4y^CRMJaAwDWi z%uw{Y_BMI7 z;_*;Y?yz8VbJc6NV_Ontqn5Tz0#*uF5?2Nnkc4HC1VDX-kX$BdK%SI|U0PjD=!9uN zmOxU+)*ci=N05Z*BdH3QwRONYJcI(-fiys3gJjbAH2{+sU>Nl#q)o_ftS0ofx^I|Z z?GQ+-1crNt4)@_O4H~ea06_yPFi=p0q|#75nlU$iHq|zkp=b~ag=W{Htku+PFt7Uk z=ASLqsAXlT1(sQmAxE04u#I6NvAml7)*v!KH YDC^9!0U31psTU?>Dg+4>(ZcwD0MsmORR910 diff --git a/js/src/jit-test/tests/binast/nonlazy/debug/onNewScript-02.binjs b/js/src/jit-test/tests/binast/nonlazy/debug/onNewScript-02.binjs deleted file mode 100644 index c5710f8e088a6fc833c95d9e942cfc6fe064f9b4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2261 zcmah}ZExC05ZcWSODtFPfKae0$zHy1F`Qz2_a~NiIkAXU4I4 z5iYu%iN>%mSP*dE%brlzjhFe@Y)dLx54NMNS6nhd-L@3mb7DkELAZUzdRCIMbQA5Vd8Ay*%Fk+d3GPVPJB;-v>QeWk=$!P;3`p~Axe2Q+2bD*uD_YhvJ;WDZNdBU-1RLuHP!sp zQ!44T087YGWv0)GA}dj&UyCay@BB{G=KQ2p5ra~;)?}aKI>>A51G5v|U2ict5Z-i( z(qm2JO}_(k6>q$4-?T28=k0h@zo-AgjxJdsb#_l(?Vbw#j>`ZCTE}wqfH5ya!x3wI z!rja%vjz^#4K6kbe0=Kz*(cq}5D~LLz7P>gQK35dRyPjJC~OWB;UOuKZ2%N-BNH`Z zqI&UnMn7KB{^jkj@3(riKP4b0PcW3Z+Fr*LTZZlW9>Xl7N*F-J)vhmy3AGRo`YLsJ z?2+H#Q7jgWe8skpOP3EuYqjQUd-NAe+(8Rfex$eUk$t;EdfVBO5cu9Mx&4JJZGT5H`M>1|5@@ zh?S_v3ag+s$FxfH7fYpysho#YaZw;E!NZ?`)_ficm}vcbnzQc?f*GQj$j}@mXw;#P zKm&X`5p0tLjv1aod}jNVI^Xl^>a@s+Gq*!HY|-v$koDN-6TjD|LaO)65-i6TZ^ifE zij2p8Z8CxuDHB@P0wy(hZxMc2LkMlI zYnZGcj4p8vSDwGjE`*LWM#~tX&|a*f+}P5!)Y>LWzgj{_0{}v4Y$5}pg$!OXv_*vU z6h@iU#-GSA&@#y`gv-)fY@o$6j11)f^Ewrphv<)-9ul?`Aqoi<8B$a@wU*OM@A9A# zq3ZX;9fVdeM!R87z^j}~3J98V`WOaC$hf5bGAR@}|9t^#jQ=+W$N{vzGZ(Qp53#YL zKi3cEq4eXqh>f|3o1Y@~R6XmOp4Uyi`BRiS1hfgw+`{_W<0$CO={y8fUeQ-WQh-+< RhnKKki=exYL$g>v_z$D{LhS$m diff --git a/js/src/jit-test/tests/binast/nonlazy/gc/bug-1161968.binjs b/js/src/jit-test/tests/binast/nonlazy/gc/bug-1161968.binjs deleted file mode 100644 index cd13375686485cda5a04687ae7617ad441c179cf..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 542 zcmZ8dZEM0X5Dp;}5fKrQAtGgrQDKZR7z|{fP7%lKhgSAQ_91PrA&{n$M%@ehC;L77 zT}#yw*}=ix^W1ayB;&dN6ynt^7%di~;FTvJHP`P0N_yUW-=rMW^lh!6D0nWrk5mZT zUfMF$R6}Ou-l!-*X-Fmz3#uUTX$I$GE)y=9-Fa0Cc)WltIz4dtLKUZxfP>nM_w%d9;t!x=wG5_HyZxuravTRC2b(0wM4e#NB8{>%F+3J`!y3Z% k3dX302(BVr!Oi9#GUEnncM+)?xLT6Lkc~a*oS{1U1>w-B#Q*>R diff --git a/js/src/jit-test/tests/binast/nonlazy/gc/bug-1161968.dir b/js/src/jit-test/tests/binast/nonlazy/gc/bug-1161968.dir deleted file mode 100644 index 922d49f22e..0000000000 --- a/js/src/jit-test/tests/binast/nonlazy/gc/bug-1161968.dir +++ /dev/null @@ -1 +0,0 @@ -// |jit-test| skip-if: !('gczeal' in this) diff --git a/js/src/jit-test/tests/debug/Source-invisible.js b/js/src/jit-test/tests/debug/Source-invisible.js index 9778f13f03..420b6faec8 100644 --- a/js/src/jit-test/tests/debug/Source-invisible.js +++ b/js/src/jit-test/tests/debug/Source-invisible.js @@ -1,11 +1,9 @@ // Looking at ScriptSourceObjects in invisible-to-debugger compartments is okay. var gi = newGlobal({ newCompartment: true, invisibleToDebugger: true }); -gi.eval('function f() {}'); var gv = newGlobal({newCompartment: true}); -gv.f = gi.f; -gv.eval('f = clone(f);'); +gi.cloneAndExecuteScript('function f() {}', gv); var dbg = new Debugger; var gvw = dbg.addDebuggee(gv); diff --git a/js/src/jit-test/tests/debug/bug1406437.js b/js/src/jit-test/tests/debug/bug1406437.js index 16ead98ba2..4085f80a2d 100644 --- a/js/src/jit-test/tests/debug/bug1406437.js +++ b/js/src/jit-test/tests/debug/bug1406437.js @@ -1,6 +1,5 @@ var g = newGlobal({newCompartment: true}); -g.f = function() {}; -g.eval('f = clone(f);'); +cloneAndExecuteScript('function f() {}', g); var dbg = new Debugger; var dg = dbg.addDebuggee(g); dg.getOwnPropertyDescriptor('f').value.script.source; diff --git a/js/src/jit-test/tests/debug/onNewScript-01.js b/js/src/jit-test/tests/debug/onNewScript-01.js index 6d48d09f74..7c820ae58b 100644 --- a/js/src/jit-test/tests/debug/onNewScript-01.js +++ b/js/src/jit-test/tests/debug/onNewScript-01.js @@ -37,9 +37,8 @@ assertEq(fn(8), 13); assertEq(hits, 1); // cloning functions across compartments -fn = g.evaluate("(function(a) { return 5 + a; })"); var g2 = newGlobal({newCompartment: true}); dbg.addDebuggee(g2, dbg); hits = 0; -g2.clone(fn); +cloneAndExecuteScript("(function(a) { return 5 + a; })", g2); assertEq(hits, 1); diff --git a/js/src/jit-test/tests/debug/onNewScript-02.js b/js/src/jit-test/tests/debug/onNewScript-02.js index a050da374b..1f284c48c3 100644 --- a/js/src/jit-test/tests/debug/onNewScript-02.js +++ b/js/src/jit-test/tests/debug/onNewScript-02.js @@ -44,7 +44,7 @@ test(function () { g.eval("var obj = {get x() { return 1; }, set x(v) { print(v) test(function () { return g.Function("a", "b", "return b - a;"); }); // cloning a function with nested functions -test(function () { g.clone(evaluate("(function(x) { return x + 1; })")); }); +test(function () { cloneAndExecuteScript("(function(x) { return x + 1; })", g); }); // eval declaring a star generator test(function () { g.eval("function* sg(n) { for (var i=0;i // strlen - -#include "jsapi.h" // sundry symbols not moved to more-specific headers yet -#include "jsfriendapi.h" -#include "jspubtd.h" // JS::RootedObjectVector - -#include "js/CompilationAndEvaluation.h" // JS::CompileFunction -#include "js/CompileOptions.h" // JS::CompileOptions -#include "js/RootingAPI.h" // JS::Rooted -#include "js/SourceText.h" // JS::Source{Ownership,Text} -#include "js/TypeDecls.h" // JSFunction, JSObject -#include "jsapi-tests/tests.h" - -BEGIN_TEST(test_cloneScript) { - JS::RootedObject A(cx, createGlobal()); - JS::RootedObject B(cx, createGlobal()); - - CHECK(A); - CHECK(B); - - static const char source[] = - "var i = 0;\n" - "var sum = 0;\n" - "while (i < 10) {\n" - " sum += i;\n" - " ++i;\n" - "}\n" - "(sum);\n"; - - JS::RootedObject obj(cx); - - // compile for A - { - JSAutoRealm a(cx, A); - - JS::SourceText srcBuf; - CHECK(srcBuf.init(cx, source, mozilla::ArrayLength(source) - 1, - JS::SourceOwnership::Borrowed)); - - JS::CompileOptions options(cx); - options.setFileAndLine(__FILE__, 1); - - JS::RootedFunction fun(cx); - JS::RootedObjectVector emptyScopeChain(cx); - fun = JS::CompileFunction(cx, emptyScopeChain, options, "f", 0, nullptr, - srcBuf); - CHECK(fun); - CHECK(obj = JS_GetFunctionObject(fun)); - } - - // clone into B - { - JSAutoRealm b(cx, B); - CHECK(JS::CloneFunctionObject(cx, obj)); - } - - return true; -} -END_TEST(test_cloneScript) - -struct Principals final : public JSPrincipals { - public: - Principals() { refcount = 0; } - - bool write(JSContext* cx, JSStructuredCloneWriter* writer) override { - MOZ_ASSERT(false, "not imlemented"); - return false; - } - - bool isSystemOrAddonPrincipal() override { return true; } -}; - -static void DestroyPrincipals(JSPrincipals* principals) { - auto p = static_cast(principals); - delete p; -} - -BEGIN_TEST(test_cloneScriptWithPrincipals) { - JS_InitDestroyPrincipalsCallback(cx, DestroyPrincipals); - - JS::AutoHoldPrincipals principalsA(cx, new Principals()); - JS::AutoHoldPrincipals principalsB(cx, new Principals()); - - JS::RootedObject A(cx, createGlobal(principalsA.get())); - JS::RootedObject B(cx, createGlobal(principalsB.get())); - - CHECK(A); - CHECK(B); - - const char* argnames[] = {"arg"}; - static const char source[] = "return function() { return arg; }"; - - JS::RootedObject obj(cx); - - // Compile in A - { - JSAutoRealm a(cx, A); - - JS::SourceText srcBuf; - CHECK(srcBuf.init(cx, source, mozilla::ArrayLength(source) - 1, - JS::SourceOwnership::Borrowed)); - - JS::CompileOptions options(cx); - options.setFileAndLine(__FILE__, 1); - - JS::RootedFunction fun(cx); - JS::RootedObjectVector emptyScopeChain(cx); - fun = JS::CompileFunction(cx, emptyScopeChain, options, "f", - mozilla::ArrayLength(argnames), argnames, srcBuf); - CHECK(fun); - - JSScript* script; - CHECK(script = JS_GetFunctionScript(cx, fun)); - - CHECK(JS_GetScriptPrincipals(script) == principalsA.get()); - CHECK(obj = JS_GetFunctionObject(fun)); - } - - // Clone into B - { - JSAutoRealm b(cx, B); - JS::RootedObject cloned(cx); - CHECK(cloned = JS::CloneFunctionObject(cx, obj)); - - JS::RootedFunction fun(cx); - JS::RootedValue clonedValue(cx, JS::ObjectValue(*cloned)); - CHECK(fun = JS_ValueToFunction(cx, clonedValue)); - - JSScript* script; - CHECK(script = JS_GetFunctionScript(cx, fun)); - - CHECK(JS_GetScriptPrincipals(script) == principalsB.get()); - - JS::RootedValue v(cx); - JS::RootedValue arg(cx, JS::Int32Value(1)); - CHECK(JS_CallFunctionValue(cx, B, clonedValue, JS::HandleValueArray(arg), - &v)); - CHECK(v.isObject()); - - JSObject* funobj = &v.toObject(); - CHECK(JS_ObjectIsFunction(funobj)); - CHECK(fun = JS_ValueToFunction(cx, v)); - CHECK(script = JS_GetFunctionScript(cx, fun)); - CHECK(JS_GetScriptPrincipals(script) == principalsB.get()); - } - - return true; -} -END_TEST(test_cloneScriptWithPrincipals) diff --git a/js/src/jsapi.cpp b/js/src/jsapi.cpp index f9bc5ee590..c2b27c7e19 100644 --- a/js/src/jsapi.cpp +++ b/js/src/jsapi.cpp @@ -3282,105 +3282,6 @@ JS_PUBLIC_API JSFunction* JS::NewFunctionFromSpec(JSContext* cx, return NewFunctionFromSpec(cx, fs, id); } -static bool IsFunctionCloneable(HandleFunction fun) { - // If a function was compiled with non-global syntactic environments on - // the environment chain, we could have baked in EnvironmentCoordinates - // into the script. We cannot clone it without breaking the compiler's - // assumptions. - for (ScopeIter si(fun->nonLazyScript()->enclosingScope()); si; si++) { - if (si.scope()->is()) { - return true; - } - if (si.hasSyntacticEnvironment()) { - return false; - } - } - - return true; -} - -static JSObject* CloneFunctionObject(JSContext* cx, HandleObject funobj, - HandleObject env, HandleScope scope) { - AssertHeapIsIdle(); - CHECK_THREAD(cx); - cx->check(env); - MOZ_ASSERT(env); - // Note that funobj can be in a different compartment. - - if (!funobj->is()) { - MOZ_RELEASE_ASSERT(!IsCrossCompartmentWrapper(funobj)); - AutoRealm ar(cx, funobj); - RootedValue v(cx, ObjectValue(*funobj)); - ReportIsNotFunction(cx, v); - return nullptr; - } - - // Only allow cloning normal, interpreted functions. - RootedFunction fun(cx, &funobj->as()); - if (fun->isNativeFun() || fun->isBoundFunction() || - fun->kind() != FunctionFlags::NormalFunction || fun->isExtended() || - fun->isSelfHostedBuiltin()) { - JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, - JSMSG_CANT_CLONE_OBJECT); - return nullptr; - } - - if (fun->hasSelfHostedLazyScript()) { - AutoRealm ar(cx, fun); - if (!JSFunction::getOrCreateScript(cx, fun)) { - return nullptr; - } - } - RootedScript script(cx, fun->nonLazyScript()); - - if (!IsFunctionCloneable(fun)) { - JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, - JSMSG_BAD_CLONE_FUNOBJ_SCOPE); - return nullptr; - } - - if (CanReuseScriptForClone(cx->realm(), fun, env)) { - return CloneFunctionReuseScript(cx, fun, env, fun->getAllocKind(), - nullptr); - } - - Rooted sourceObject(cx, script->sourceObject()); - if (cx->compartment() != sourceObject->compartment()) { - sourceObject = ScriptSourceObject::clone(cx, sourceObject); - if (!sourceObject) { - return nullptr; - } - } - - JSFunction* clone = CloneFunctionAndScript(cx, fun, env, scope, sourceObject, - fun->getAllocKind()); - -#ifdef DEBUG - // The cloned function should itself be cloneable. - RootedFunction cloneRoot(cx, clone); - MOZ_ASSERT_IF(cloneRoot, IsFunctionCloneable(cloneRoot)); -#endif - - return clone; -} - -JS_PUBLIC_API JSObject* JS::CloneFunctionObject(JSContext* cx, - HandleObject funobj) { - RootedObject globalLexical(cx, &cx->global()->lexicalEnvironment()); - RootedScope emptyGlobalScope(cx, &cx->global()->emptyGlobalScope()); - return CloneFunctionObject(cx, funobj, globalLexical, emptyGlobalScope); -} - -extern JS_PUBLIC_API JSObject* JS::CloneFunctionObject( - JSContext* cx, HandleObject funobj, HandleObjectVector envChain) { - RootedObject env(cx); - RootedScope scope(cx); - if (!CreateNonSyntacticEnvironmentChain(cx, envChain, &env)) { - return nullptr; - } - return CloneFunctionObject(cx, funobj, env, scope); -} - JS_PUBLIC_API JSObject* JS_GetFunctionObject(JSFunction* fun) { return fun; } JS_PUBLIC_API JSString* JS_GetFunctionId(JSFunction* fun) { @@ -5700,19 +5601,6 @@ JS_PUBLIC_API JS::TranscodeResult JS::EncodeScript(JSContext* cx, return JS::TranscodeResult::Ok; } -JS_PUBLIC_API JS::TranscodeResult JS::EncodeInterpretedFunction( - JSContext* cx, TranscodeBuffer& buffer, HandleObject funobjArg) { - XDREncoder encoder(cx, buffer, buffer.length()); - RootedFunction funobj(cx, &funobjArg->as()); - XDRResult res = encoder.codeFunction(&funobj); - if (res.isErr()) { - buffer.clearAndFree(); - return res.unwrapErr(); - } - MOZ_ASSERT(!buffer.empty()); - return JS::TranscodeResult::Ok; -} - JS_PUBLIC_API JS::TranscodeResult JS::DecodeScript( JSContext* cx, const ReadOnlyCompileOptions& options, TranscodeBuffer& buffer, JS::MutableHandleScript scriptp, @@ -5804,24 +5692,6 @@ JS_PUBLIC_API JS::TranscodeResult JS::DecodeScript( return JS::TranscodeResult::Ok; } -JS_PUBLIC_API JS::TranscodeResult JS::DecodeInterpretedFunction( - JSContext* cx, const ReadOnlyCompileOptions& options, - TranscodeBuffer& buffer, JS::MutableHandleFunction funp, - size_t cursorIndex) { - Rooted> decoder( - cx, js::MakeUnique(cx, &options, buffer, cursorIndex)); - if (!decoder) { - ReportOutOfMemory(cx); - return JS::TranscodeResult::Throw; - } - XDRResult res = decoder->codeFunction(funp); - MOZ_ASSERT(bool(funp) == res.isOk()); - if (res.isErr()) { - return res.unwrapErr(); - } - return JS::TranscodeResult::Ok; -} - JS_PUBLIC_API JS::TranscodeResult JS::DecodeScriptAndStartIncrementalEncoding( JSContext* cx, const ReadOnlyCompileOptions& options, TranscodeBuffer& buffer, JS::MutableHandleScript scriptp, diff --git a/js/src/jsapi.h b/js/src/jsapi.h index c950cbd1e5..10ba58fb2c 100644 --- a/js/src/jsapi.h +++ b/js/src/jsapi.h @@ -1676,25 +1676,6 @@ extern JS_PUBLIC_API bool JS_IsFunctionBound(JSFunction* fun); extern JS_PUBLIC_API JSObject* JS_GetBoundFunctionTarget(JSFunction* fun); -namespace JS { - -/** - * Clone a top-level function into cx's global. This function will dynamically - * fail if funobj was lexically nested inside some other function. - */ -extern JS_PUBLIC_API JSObject* CloneFunctionObject(JSContext* cx, - HandleObject funobj); - -/** - * As above, but providing an explicit scope chain. scopeChain must not include - * the global object on it; that's implicit. It needs to contain the other - * objects that should end up on the clone's scope chain. - */ -extern JS_PUBLIC_API JSObject* CloneFunctionObject( - JSContext* cx, HandleObject funobj, HandleObjectVector scopeChain); - -} // namespace JS - extern JS_PUBLIC_API JSObject* JS_GetGlobalFromScript(JSScript* script); extern JS_PUBLIC_API const char* JS_GetScriptFilename(JSScript* script); diff --git a/js/src/jsfriendapi.h b/js/src/jsfriendapi.h index 0035b7d0a7..76ae2ec229 100644 --- a/js/src/jsfriendapi.h +++ b/js/src/jsfriendapi.h @@ -190,26 +190,6 @@ extern JS_FRIEND_API bool GetIsSecureContext(JS::Realm* realm); extern JS_FRIEND_API bool JS_CopyOwnPropertiesAndPrivateFields( JSContext* cx, JS::HandleObject target, JS::HandleObject obj); -/* - * Single-property version of the above. This function asserts that an |own| - * property of the given name exists on |obj|. - * - * On entry, |cx| must be same-compartment with |obj|. |target| must not be a - * cross-compartment wrapper because we have to enter its realm. - * - * The copyBehavior argument controls what happens with - * non-configurable properties. - */ -typedef enum { - MakeNonConfigurableIntoConfigurable, - CopyNonConfigurableAsIs -} PropertyCopyBehavior; - -extern JS_FRIEND_API bool JS_CopyPropertyFrom( - JSContext* cx, JS::HandleId id, JS::HandleObject target, - JS::HandleObject obj, - PropertyCopyBehavior copyBehavior = CopyNonConfigurableAsIs); - extern JS_FRIEND_API bool JS_WrapPropertyDescriptor( JSContext* cx, JS::MutableHandle desc); diff --git a/js/src/shell/js.cpp b/js/src/shell/js.cpp index defa0fe6d9..cace6c54a7 100644 --- a/js/src/shell/js.cpp +++ b/js/src/shell/js.cpp @@ -3852,59 +3852,6 @@ static bool Intern(JSContext* cx, unsigned argc, Value* vp) { return true; } -static bool Clone(JSContext* cx, unsigned argc, Value* vp) { - CallArgs args = CallArgsFromVp(argc, vp); - - if (args.length() == 0) { - JS_ReportErrorASCII(cx, "Invalid arguments to clone"); - return false; - } - - RootedObject funobj(cx); - { - Maybe ar; - RootedObject obj(cx, args[0].isPrimitive() ? nullptr : &args[0].toObject()); - - if (obj && obj->is()) { - obj = UncheckedUnwrap(obj); - ar.emplace(cx, obj); - args[0].setObject(*obj); - } - if (obj && obj->is()) { - funobj = obj; - } else { - JSFunction* fun = JS_ValueToFunction(cx, args[0]); - if (!fun) { - return false; - } - funobj = JS_GetFunctionObject(fun); - } - } - - RootedObject env(cx); - if (args.length() > 1) { - if (!JS_ValueToObject(cx, args[1], &env)) { - return false; - } - } else { - env = JS::CurrentGlobalOrNull(cx); - MOZ_ASSERT(env); - } - - // Should it worry us that we might be getting with wrappers - // around with wrappers here? - JS::RootedObjectVector envChain(cx); - if (env && !env->is() && !envChain.append(env)) { - return false; - } - JSObject* clone = JS::CloneFunctionObject(cx, funobj, envChain); - if (!clone) { - return false; - } - args.rval().setObject(*clone); - return true; -} - static bool Crash(JSContext* cx, unsigned argc, Value* vp) { CallArgs args = CallArgsFromVp(argc, vp); if (args.length() == 0) { @@ -8717,10 +8664,6 @@ static bool TransplantableObject(JSContext* cx, unsigned argc, Value* vp) { // clang-format off static const JSFunctionSpecWithHelp shell_functions[] = { - JS_FN_HELP("clone", Clone, 1, 0, -"clone(fun[, scope])", -" Clone function object."), - JS_FN_HELP("options", Options, 0, 0, "options([option ...])", " Get or toggle JavaScript options."), diff --git a/js/src/tests/non262/async-functions/clone.js b/js/src/tests/non262/async-functions/clone.js index 3ca2838223..42d4b883df 100644 --- a/js/src/tests/non262/async-functions/clone.js +++ b/js/src/tests/non262/async-functions/clone.js @@ -1,17 +1,4 @@ -// |reftest| skip-if(!xulRuntime.shell) -- needs clone, cloneAndExecuteScript, drainJobQueue - -// Async functions can be cloned. -let f = clone(async function f() { - var a = await 1; - var b = await 2; - var c = await 3; - return a + b + c; -}); - -var V; -f().then(v => V = v); -drainJobQueue(); -assertEq(V, 6); +// |reftest| skip-if(!xulRuntime.shell) -- needs cloneAndExecuteScript, drainJobQueue // Async function source code scripts can be cloned. let g = newGlobal(); diff --git a/js/src/tests/non262/extensions/regress-300079.js b/js/src/tests/non262/extensions/regress-300079.js index 2d47faea8f..86457687c9 100644 --- a/js/src/tests/non262/extensions/regress-300079.js +++ b/js/src/tests/non262/extensions/regress-300079.js @@ -25,12 +25,10 @@ function test() else { expect = 'PASSED'; - f = evaluate("(function () { return a * a; })"); - g = clone(f, {a: 3}); - f = null; + f = evaluate("(function () { return a * a; })", {envChainObject: {a: 3}}); gc(); try { - a_squared = g(2); + a_squared = f(2); if (a_squared != 9) throw "Unexpected return from g: a_squared == " + a_squared; actual = "PASSED"; diff --git a/js/src/tests/non262/regress/regress-127557.js b/js/src/tests/non262/regress/regress-127557.js deleted file mode 100644 index 573f0ee35a..0000000000 --- a/js/src/tests/non262/regress/regress-127557.js +++ /dev/null @@ -1,76 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -/* - * - * Date: 06 Mar 2002 - * SUMMARY: Testing cloned function objects - * See http://bugzilla.mozilla.org/show_bug.cgi?id=127557 - * - * Before this bug was fixed, this testcase would error when run: - * - * ReferenceError: h_peer is not defined - * - * The line |g.prototype = new Object| below is essential: this is - * what was confusing the engine in its attempt to look up h_peer - */ -//----------------------------------------------------------------------------- -var UBound = 0; -var BUGNUMBER = 127557; -var summary = 'Testing cloned function objects'; -var cnCOMMA = ','; -var status = ''; -var statusitems = []; -var actual = ''; -var actualvalues = []; -var expect= ''; -var expectedvalues = []; - -if (typeof clone == 'function') -{ - status = inSection(1); - var f = evaluate("(function(x, y) {\n" + - " function h() { return h_peer(); }\n" + - " function h_peer() { return (x + cnCOMMA + y); }\n" + - " return h;\n" + - "})"); - var g = clone(f); - g.prototype = new Object; - var h = g(5,6); - actual = h(); - expect = '5,6'; - addThis(); -} -else -{ - reportCompare('Test not run', 'Test not run', 'shell only test requires clone()'); -} - - - -//----------------------------------------------------------------------------- -test(); -//----------------------------------------------------------------------------- - - - -function addThis() -{ - statusitems[UBound] = status; - actualvalues[UBound] = actual; - expectedvalues[UBound] = expect; - UBound++; -} - - -function test() -{ - printBugNumber(BUGNUMBER); - printStatus(summary); - - for (var i=0; imarkId(id); RootedId wrappedId(cx, id); @@ -1070,7 +1064,7 @@ JS_FRIEND_API bool JS_CopyOwnPropertiesAndPrivateFields(JSContext* cx, } for (size_t i = 0; i < props.length(); ++i) { - if (!JS_CopyPropertyFrom(cx, props[i], target, obj)) { + if (!CopyPropertyFrom(cx, props[i], target, obj)) { return false; } } diff --git a/js/xpconnect/crashtests/471366-1.html b/js/xpconnect/crashtests/471366-1.html deleted file mode 100644 index b450d5e12a..0000000000 --- a/js/xpconnect/crashtests/471366-1.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - diff --git a/js/xpconnect/crashtests/crashtests.list b/js/xpconnect/crashtests/crashtests.list index ab9aa23eaf..066fff7fd6 100644 --- a/js/xpconnect/crashtests/crashtests.list +++ b/js/xpconnect/crashtests/crashtests.list @@ -15,7 +15,6 @@ load 420513-1.html load 453935-1.html load 467693-1.html load 468552-1.html -load 471366-1.html load 475185-1.html load 475291-1.html load 503286-1.html diff --git a/js/xpconnect/idl/nsIXPConnect.idl b/js/xpconnect/idl/nsIXPConnect.idl index dbfceb549d..bf11085004 100644 --- a/js/xpconnect/idl/nsIXPConnect.idl +++ b/js/xpconnect/idl/nsIXPConnect.idl @@ -267,12 +267,5 @@ interface nsIXPConnect : nsISupports in JSContextPtr aJSContext, in const_JSReadOnlyCompileOptionsRef aOptions); - [noscript] void writeFunction(in nsIObjectOutputStream aStream, - in JSContextPtr aJSContext, - in JSObjectPtr aJSObject); - - [noscript] JSObjectPtr readFunction(in nsIObjectInputStream aStream, - in JSContextPtr aJSContext); - [infallible] readonly attribute boolean isShuttingDown; }; diff --git a/js/xpconnect/src/Sandbox.cpp b/js/xpconnect/src/Sandbox.cpp index 85dfc67a1f..842789eded 100644 --- a/js/xpconnect/src/Sandbox.cpp +++ b/js/xpconnect/src/Sandbox.cpp @@ -66,9 +66,13 @@ #include "mozilla/dom/XMLHttpRequest.h" #include "mozilla/dom/XMLSerializerBinding.h" #include "mozilla/dom/FormDataBinding.h" +#include "mozilla/dom/nsCSPContext.h" #include "mozilla/BasePrincipal.h" #include "mozilla/DeferredFinalize.h" +#include "mozilla/ExtensionPolicyService.h" #include "mozilla/NullPrincipal.h" +#include "mozilla/ResultExtensions.h" +#include "mozilla/StaticPrefs_extensions.h" using namespace mozilla; using namespace JS; @@ -336,6 +340,46 @@ static bool SandboxCreateFetch(JSContext* cx, HandleObject obj) { dom::Headers_Binding::GetConstructorObject(cx); } +static bool SandboxStructuredClone(JSContext* cx, unsigned argc, Value* vp) { + CallArgs args = CallArgsFromVp(argc, vp); + + if (!args.requireAtLeast(cx, "structuredClone", 1)) { + return false; + } + + RootedDictionary options(cx); + BindingCallContext callCx(cx, "structuredClone"); + if (!options.Init(cx, args.hasDefined(1) ? args[1] : JS::NullHandleValue, + "Argument 2", false)) { + return false; + } + + nsIGlobalObject* global = CurrentNativeGlobal(cx); + if (!global) { + JS_ReportErrorASCII(cx, "structuredClone: Missing global"); + return false; + } + + JS::Rooted result(cx); + ErrorResult rv; + nsContentUtils::StructuredClone(cx, global, args[0], options, &result, rv); + if (rv.MaybeSetPendingException(cx)) { + return false; + } + + MOZ_ASSERT_IF(result.isGCThing(), + !JS::GCThingIsMarkedGray(result.toGCCellPtr())); + args.rval().set(result); + return true; +} + +static bool SandboxCreateStructuredClone(JSContext* cx, HandleObject obj) { + MOZ_ASSERT(JS_IsGlobalObject(obj)); + + return JS_DefineFunction(cx, obj, "structuredClone", SandboxStructuredClone, + 1, 0); +} + static bool SandboxIsProxy(JSContext* cx, unsigned argc, Value* vp) { CallArgs args = CallArgsFromVp(argc, vp); if (args.length() < 1) { @@ -880,6 +924,8 @@ bool xpc::GlobalProperties::Parse(JSContext* cx, JS::HandleObject obj) { crypto = true; } else if (JS_LinearStringEqualsLiteral(nameStr, "fetch")) { fetch = true; + } else if (JS_LinearStringEqualsLiteral(nameStr, "structuredClone")) { + structuredClone = true; } else if (JS_LinearStringEqualsLiteral(nameStr, "indexedDB")) { indexedDB = true; #ifdef MOZ_WEBRTC @@ -1000,6 +1046,10 @@ bool xpc::GlobalProperties::Define(JSContext* cx, JS::HandleObject obj) { return false; } + if (structuredClone && !SandboxCreateStructuredClone(cx, obj)) { + return false; + } + #ifdef MOZ_WEBRTC if (rtcIdentityProvider && !SandboxCreateRTCIdentityProvider(cx, obj)) { return false; @@ -1029,6 +1079,75 @@ bool xpc::GlobalProperties::DefineInSandbox(JSContext* cx, return Define(cx, obj); } +/** + * If enabled, apply the extension base CSP, then apply the + * content script CSP which will either be a default or one + * provided by the extension in its manifest. + */ +nsresult ApplyAddonContentScriptCSP(nsISupports* prinOrSop) { + if (!StaticPrefs::extensions_content_script_csp_enabled()) { + return NS_OK; + } + nsCOMPtr principal = do_QueryInterface(prinOrSop); + if (!principal) { + return NS_OK; + } + + auto* basePrin = BasePrincipal::Cast(principal); + // We only get an addonPolicy if the principal is an + // expanded principal with an extension principal in it. + auto* addonPolicy = basePrin->ContentScriptAddonPolicy(); + if (!addonPolicy) { + return NS_OK; + } + + nsString url; + MOZ_TRY_VAR(url, addonPolicy->GetURL(NS_LITERAL_STRING(""))); + + nsCOMPtr selfURI; + MOZ_TRY(NS_NewURI(getter_AddRefs(selfURI), url)); + + nsAutoString baseCSP; + MOZ_ALWAYS_SUCCEEDS( + ExtensionPolicyService::GetSingleton().GetBaseCSP(baseCSP)); + + // If we got here, we're definitly an expanded principal. + auto expanded = basePrin->As(); + nsCOMPtr csp; + +#ifdef MOZ_DEBUG + // Bug 1548468: Move CSP off ExpandedPrincipal + expanded->GetCsp(getter_AddRefs(csp)); + if (csp) { + uint32_t count = 0; + csp->GetPolicyCount(&count); + if (count > 0) { + // Ensure that the policy was not already added. + nsAutoString parsedPolicyStr; + for (uint32_t i = 0; i < count; i++) { + csp->GetPolicyString(i, parsedPolicyStr); + MOZ_ASSERT(!parsedPolicyStr.Equals(baseCSP)); + } + } + } +#endif + + csp = new nsCSPContext(); + MOZ_TRY( + csp->SetRequestContextWithPrincipal(expanded, selfURI, EmptyString(), 0)); + + bool reportOnly = StaticPrefs::extensions_content_script_csp_report_only(); + + MOZ_TRY(csp->AppendPolicy(baseCSP, reportOnly, false)); + + // Set default or extension provided csp. + const nsAString& contentScriptCSP = addonPolicy->ContentScriptCSP(); + MOZ_TRY(csp->AppendPolicy(contentScriptCSP, reportOnly, false)); + + expanded->SetCsp(csp); + return NS_OK; +} + nsresult xpc::CreateSandboxObject(JSContext* cx, MutableHandleValue vp, nsISupports* prinOrSop, SandboxOptions& options) { @@ -1111,8 +1230,6 @@ nsresult xpc::CreateSandboxObject(JSContext* cx, MutableHandleValue vp, MOZ_RELEASE_ASSERT(priv->allowWaivers == options.allowWaivers); MOZ_RELEASE_ASSERT(priv->isWebExtensionContentScript == options.isWebExtensionContentScript); - MOZ_RELEASE_ASSERT(priv->isContentXBLCompartment == - options.isContentXBLScope); MOZ_RELEASE_ASSERT(priv->isUAWidgetCompartment == options.isUAWidgetScope); MOZ_RELEASE_ASSERT(priv->hasExclusiveExpandos == hasExclusiveExpandos); MOZ_RELEASE_ASSERT(priv->wantXrays == wantXrays); @@ -1120,7 +1237,6 @@ nsresult xpc::CreateSandboxObject(JSContext* cx, MutableHandleValue vp, CompartmentPrivate* priv = CompartmentPrivate::Get(sandbox); priv->allowWaivers = options.allowWaivers; priv->isWebExtensionContentScript = options.isWebExtensionContentScript; - priv->isContentXBLCompartment = options.isContentXBLScope; priv->isUAWidgetCompartment = options.isUAWidgetScope; priv->hasExclusiveExpandos = hasExclusiveExpandos; priv->wantXrays = wantXrays; @@ -1779,6 +1895,8 @@ nsresult nsXPCComponents_utils_Sandbox::CallOrConstruct( } else { ok = GetExpandedPrincipal(cx, obj, options, getter_AddRefs(expanded)); prinOrSop = expanded; + // If this is an addon content script we need to apply the csp. + MOZ_TRY(ApplyAddonContentScriptCSP(prinOrSop)); } } else { ok = GetPrincipalOrSOP(cx, obj, getter_AddRefs(prinOrSop)); diff --git a/js/xpconnect/src/XPCJSRuntime.cpp b/js/xpconnect/src/XPCJSRuntime.cpp index 3798e3165e..3fe3942970 100644 --- a/js/xpconnect/src/XPCJSRuntime.cpp +++ b/js/xpconnect/src/XPCJSRuntime.cpp @@ -200,7 +200,6 @@ CompartmentPrivate::CompartmentPrivate( wantXrays(false), allowWaivers(true), isWebExtensionContentScript(false), - isContentXBLCompartment(false), isUAWidgetCompartment(false), hasExclusiveExpandos(false), wasShutdown(false), @@ -497,20 +496,6 @@ Scriptability& Scriptability::Get(JSObject* aScope) { return RealmPrivate::Get(aScope)->scriptability; } -bool IsContentXBLCompartment(JS::Compartment* compartment) { - // We always eagerly create compartment privates for content XBL compartments. - CompartmentPrivate* priv = CompartmentPrivate::Get(compartment); - return priv && priv->isContentXBLCompartment; -} - -bool IsContentXBLScope(JS::Realm* realm) { - return IsContentXBLCompartment(JS::GetCompartmentForRealm(realm)); -} - -bool IsInContentXBLScope(JSObject* obj) { - return IsContentXBLCompartment(JS::GetCompartment(obj)); -} - bool IsUAWidgetCompartment(JS::Compartment* compartment) { // We always eagerly create compartment privates for UA Widget compartments. CompartmentPrivate* priv = CompartmentPrivate::Get(compartment); @@ -2075,11 +2060,7 @@ class OrphanReporter : public JS::ObjectPrivateVisitor { virtual size_t sizeOfIncludingThis(nsISupports* aSupports) override { nsCOMPtr node = do_QueryInterface(aSupports); - // https://bugzilla.mozilla.org/show_bug.cgi?id=773533#c11 explains that we - // have to skip XBL elements because they violate certain assumptions. Yuk. - if (!node || node->IsInComposedDoc() || - (node->IsElement() && - node->AsElement()->IsInNamespace(kNameSpaceID_XBL))) { + if (!node || node->IsInComposedDoc()) { return 0; } diff --git a/js/xpconnect/src/XPCShellImpl.cpp b/js/xpconnect/src/XPCShellImpl.cpp index 13d231762d..4223358e11 100644 --- a/js/xpconnect/src/XPCShellImpl.cpp +++ b/js/xpconnect/src/XPCShellImpl.cpp @@ -1014,7 +1014,7 @@ static bool GetCurrentWorkingDirectory(nsAString& workingDirectory) { // size back down to the actual string length cwd.SetLength(strlen(result) + 1); cwd.Replace(cwd.Length() - 1, 1, '/'); - workingDirectory = NS_ConvertUTF8toUTF16(cwd); + CopyUTF8toUTF16(cwd, workingDirectory); #endif return true; } diff --git a/js/xpconnect/src/XPCWrappedNativeScope.cpp b/js/xpconnect/src/XPCWrappedNativeScope.cpp index 877fc4e66c..c0f08eb5ba 100644 --- a/js/xpconnect/src/XPCWrappedNativeScope.cpp +++ b/js/xpconnect/src/XPCWrappedNativeScope.cpp @@ -173,19 +173,6 @@ bool XPCWrappedNativeScope::AttachComponentsObject(JSContext* aCx) { return true; } -JSObject* XPCWrappedNativeScope::EnsureContentXBLScope(JSContext* cx) { - JS::RootedObject global(cx, CurrentGlobalOrNull(cx)); - MOZ_ASSERT(js::IsObjectInContextCompartment(global, cx)); - MOZ_ASSERT(!IsContentXBLScope()); - MOZ_ASSERT(strcmp(js::GetObjectClass(global)->name, - "nsXBLPrototypeScript compilation scope")); - - // We can probably remove EnsureContentXBLScope and clean up all its callers, - // but a bunch (all?) of those callers will just go away when we remove XBL - // support, so it's simpler to just leave it here as a no-op. - return global; -} - bool XPCWrappedNativeScope::XBLScopeStateMatches(nsIPrincipal* aPrincipal) { return mAllowContentXBLScope == !RemoteXULForbidsXBLScopeForPrincipal(aPrincipal); @@ -199,19 +186,6 @@ bool XPCWrappedNativeScope::AllowContentXBLScope(Realm* aRealm) { } namespace xpc { -JSObject* GetXBLScope(JSContext* cx, JSObject* contentScopeArg) { - JS::RootedObject contentScope(cx, contentScopeArg); - JSAutoRealm ar(cx, contentScope); - XPCWrappedNativeScope* nativeScope = ObjectScope(contentScope); - - RootedObject scope(cx, nativeScope->EnsureContentXBLScope(cx)); - NS_ENSURE_TRUE(scope, nullptr); // See bug 858642. - - scope = js::UncheckedUnwrap(scope); - JS::ExposeObjectToActiveJS(scope); - return scope; -} - JSObject* GetUAWidgetScope(JSContext* cx, JSObject* contentScopeArg) { JS::RootedObject contentScope(cx, contentScopeArg); JSAutoRealm ar(cx, contentScope); diff --git a/js/xpconnect/src/nsXPConnect.cpp b/js/xpconnect/src/nsXPConnect.cpp index 2bce0fd6af..912401a208 100644 --- a/js/xpconnect/src/nsXPConnect.cpp +++ b/js/xpconnect/src/nsXPConnect.cpp @@ -909,17 +909,10 @@ void SetLocationForGlobal(JSObject* global, nsIURI* locationURI) { } // namespace xpc -static nsresult WriteScriptOrFunction(nsIObjectOutputStream* stream, - JSContext* cx, JSScript* scriptArg, - HandleObject functionObj) { - // Exactly one of script or functionObj must be given - MOZ_ASSERT(!scriptArg != !functionObj); - +NS_IMETHODIMP +nsXPConnect::WriteScript(nsIObjectOutputStream* stream, JSContext* cx, + JSScript* scriptArg) { RootedScript script(cx, scriptArg); - if (!script) { - RootedFunction fun(cx, JS_GetObjectFunction(functionObj)); - script.set(JS_GetFunctionScript(cx, fun)); - } uint8_t flags = 0; // We don't have flags anymore. nsresult rv = stream->Write8(flags); @@ -929,13 +922,7 @@ static nsresult WriteScriptOrFunction(nsIObjectOutputStream* stream, TranscodeBuffer buffer; TranscodeResult code; - { - if (functionObj) { - code = EncodeInterpretedFunction(cx, buffer, functionObj); - } else { - code = EncodeScript(cx, buffer, script); - } - } + code = EncodeScript(cx, buffer, script); if (code != TranscodeResult::Ok) { if (code == TranscodeResult::Throw) { @@ -960,14 +947,10 @@ static nsresult WriteScriptOrFunction(nsIObjectOutputStream* stream, return rv; } -static nsresult ReadScriptOrFunction(nsIObjectInputStream* stream, - JSContext* cx, - const JS::ReadOnlyCompileOptions& options, - JSScript** scriptp, - JSObject** functionObjp) { - // Exactly one of script or functionObj must be given - MOZ_ASSERT(!scriptp != !functionObjp); - +NS_IMETHODIMP +nsXPConnect::ReadScript(nsIObjectInputStream* stream, JSContext* cx, + const JS::ReadOnlyCompileOptions& options, + JSScript** scriptp) { uint8_t flags; nsresult rv = stream->Read8(&flags); if (NS_FAILED(rv)) { @@ -1001,27 +984,14 @@ static nsresult ReadScriptOrFunction(nsIObjectInputStream* stream, { TranscodeResult code; - if (scriptp) { - Rooted script(cx); - code = DecodeScript(cx, options, buffer, &script); - if (code == TranscodeResult::Ok) { - *scriptp = script.get(); - } else { - if (code == TranscodeResult::Throw) { - JS_ClearPendingException(cx); - return NS_ERROR_OUT_OF_MEMORY; - } - } + Rooted script(cx); + code = DecodeScript(cx, options, buffer, &script); + if (code == TranscodeResult::Ok) { + *scriptp = script.get(); } else { - Rooted funobj(cx); - code = DecodeInterpretedFunction(cx, options, buffer, &funobj); - if (code == TranscodeResult::Ok) { - *functionObjp = JS_GetFunctionObject(funobj.get()); - } else { - if (code == TranscodeResult::Throw) { - JS_ClearPendingException(cx); - return NS_ERROR_OUT_OF_MEMORY; - } + if (code == TranscodeResult::Throw) { + JS_ClearPendingException(cx); + return NS_ERROR_OUT_OF_MEMORY; } } @@ -1032,34 +1002,6 @@ static nsresult ReadScriptOrFunction(nsIObjectInputStream* stream, return rv; } -NS_IMETHODIMP -nsXPConnect::WriteScript(nsIObjectOutputStream* stream, JSContext* cx, - JSScript* script) { - return WriteScriptOrFunction(stream, cx, script, nullptr); -} - -NS_IMETHODIMP -nsXPConnect::ReadScript(nsIObjectInputStream* stream, JSContext* cx, - const JS::ReadOnlyCompileOptions& options, - JSScript** scriptp) { - return ReadScriptOrFunction(stream, cx, options, scriptp, nullptr); -} - -NS_IMETHODIMP -nsXPConnect::WriteFunction(nsIObjectOutputStream* stream, JSContext* cx, - JSObject* functionObjArg) { - RootedObject functionObj(cx, functionObjArg); - return WriteScriptOrFunction(stream, cx, nullptr, functionObj); -} - -NS_IMETHODIMP -nsXPConnect::ReadFunction(nsIObjectInputStream* stream, JSContext* cx, - JSObject** functionObjp) { - JS::CompileOptions compileOptions(cx); - return ReadScriptOrFunction(stream, cx, compileOptions, nullptr, - functionObjp); -} - NS_IMETHODIMP nsXPConnect::GetIsShuttingDown(bool* aIsShuttingDown) { if (!aIsShuttingDown) { @@ -1144,8 +1086,7 @@ bool IsChromeOrXBL(JSContext* cx, JSObject* /* unused */) { // Note that, for performance, we don't check AllowXULXBLForPrincipal here, // and instead rely on the fact that AllowContentXBLScope() only returns false // in remote XUL situations. - return AccessCheck::isChrome(c) || IsContentXBLCompartment(c) || - !AllowContentXBLScope(realm); + return AccessCheck::isChrome(c) || !AllowContentXBLScope(realm); } bool IsNotUAWidget(JSContext* cx, JSObject* /* unused */) { diff --git a/js/xpconnect/src/xpc.msg b/js/xpconnect/src/xpc.msg index 37b5b36fa0..475f6b0c37 100644 --- a/js/xpconnect/src/xpc.msg +++ b/js/xpconnect/src/xpc.msg @@ -60,7 +60,6 @@ XPC_MSG_DEF(NS_ERROR_XPC_BAD_INITIALIZER_NAME , "Bad initializer name XPC_MSG_DEF(NS_ERROR_XPC_HAS_BEEN_SHUTDOWN , "Operation failed because the XPConnect subsystem has been shutdown") XPC_MSG_DEF(NS_ERROR_XPC_CANT_MODIFY_PROP_ON_WN , "Cannot modify properties of a WrappedNative") XPC_MSG_DEF(NS_ERROR_XPC_BAD_CONVERT_JS_ZERO_ISNOT_NULL , "Could not convert JavaScript argument - 0 was passed, expected object. Did you mean null?") -XPC_MSG_DEF(NS_ERROR_XPC_CANT_PASS_CPOW_TO_NATIVE , "It's illegal to pass a CPOW to native code") /* common global codes (from nsError.h) */ diff --git a/js/xpconnect/src/xpcprivate.h b/js/xpconnect/src/xpcprivate.h index 45f8c0d268..365d303c0b 100644 --- a/js/xpconnect/src/xpcprivate.h +++ b/js/xpconnect/src/xpcprivate.h @@ -880,12 +880,6 @@ class XPCWrappedNativeScope final void AddSizeOfIncludingThis(JSContext* cx, ScopeSizeInfo* scopeSizeInfo); - // Gets the appropriate scope object for XBL in this compartment. This method - // relies on compartment-per-global still (and release-asserts this). The - // context must be same-realm with this compartment's single global upon - // entering, and the scope object is wrapped into this compartment. - JSObject* EnsureContentXBLScope(JSContext* cx); - // Check whether our mAllowContentXBLScope state matches the given // principal. This is used to avoid sharing compartments on // mismatch. @@ -906,9 +900,6 @@ class XPCWrappedNativeScope final return js::GetFirstGlobalInCompartment(Compartment()); } - bool IsContentXBLScope() { - return xpc::IsContentXBLCompartment(Compartment()); - } bool AllowContentXBLScope(JS::Realm* aRealm); // ID Object prototype caches. @@ -2296,6 +2287,7 @@ struct GlobalProperties { bool caches : 1; bool crypto : 1; bool fetch : 1; + bool structuredClone : 1; bool indexedDB : 1; bool rtcIdentityProvider : 1; @@ -2346,7 +2338,6 @@ class MOZ_STACK_CLASS SandboxOptions : public OptionsBase { sameZoneAs(cx), freshCompartment(false), freshZone(false), - isContentXBLScope(false), isUAWidgetScope(false), invisibleToDebugger(false), discardSource(false), @@ -2366,7 +2357,6 @@ class MOZ_STACK_CLASS SandboxOptions : public OptionsBase { JS::RootedObject sameZoneAs; bool freshCompartment; bool freshZone; - bool isContentXBLScope; bool isUAWidgetScope; bool invisibleToDebugger; bool discardSource; @@ -2644,8 +2634,7 @@ class CompartmentPrivate { // Don't share if we have any weird state set. return !wantXrays && !isWebExtensionContentScript && - !isContentXBLCompartment && !isUAWidgetCompartment && - mScope->XBLScopeStateMatches(principal); + !isUAWidgetCompartment && mScope->XBLScopeStateMatches(principal); } CompartmentOriginInfo originInfo; @@ -2665,10 +2654,6 @@ class CompartmentPrivate { // receives various bits of special compatibility behavior. bool isWebExtensionContentScript; - // True if this compartment is a content XBL compartment. Every global in - // such a compartment is a content XBL scope. - bool isContentXBLCompartment; - // True if this compartment is a UA widget compartment. bool isUAWidgetCompartment; diff --git a/js/xpconnect/src/xpcpublic.h b/js/xpconnect/src/xpcpublic.h index 52cb6f0d78..7c91e0434f 100644 --- a/js/xpconnect/src/xpcpublic.h +++ b/js/xpconnect/src/xpcpublic.h @@ -110,10 +110,6 @@ JSObject* TransplantObjectRetainingXrayExpandos(JSContext* cx, JS::HandleObject origobj, JS::HandleObject target); -bool IsContentXBLCompartment(JS::Compartment* compartment); -bool IsContentXBLScope(JS::Realm* realm); -bool IsInContentXBLScope(JSObject* obj); - bool IsUAWidgetCompartment(JS::Compartment* compartment); bool IsUAWidgetScope(JS::Realm* realm); bool IsInUAWidgetScope(JSObject* obj); @@ -122,33 +118,10 @@ bool MightBeWebContentCompartment(JS::Compartment* compartment); void SetCompartmentChangedDocumentDomain(JS::Compartment* compartment); -// Return a raw XBL scope object corresponding to contentScope, which must -// be an object whose global is a DOM window. -// -// The return value is not wrapped into cx->compartment, so be sure to enter -// its compartment before doing anything meaningful. -// -// Also note that XBL scopes are lazily created, so the return-value should be -// null-checked unless the caller can ensure that the scope must already -// exist. -// -// This function asserts if |contentScope| is itself in an XBL scope to catch -// sloppy consumers. Conversely, GetXBLScopeOrGlobal will handle objects that -// are in XBL scope (by just returning the global). -JSObject* GetXBLScope(JSContext* cx, JSObject* contentScope); - JSObject* GetUAWidgetScope(JSContext* cx, nsIPrincipal* principal); JSObject* GetUAWidgetScope(JSContext* cx, JSObject* contentScope); -inline JSObject* GetXBLScopeOrGlobal(JSContext* cx, JSObject* obj) { - MOZ_ASSERT(!js::IsCrossCompartmentWrapper(obj)); - if (IsInContentXBLScope(obj)) { - return JS::GetNonCCWObjectGlobal(obj); - } - return GetXBLScope(cx, obj); -} - // Returns whether XBL scopes have been explicitly disabled for code running // in this compartment. See the comment around mAllowContentXBLScope. bool AllowContentXBLScope(JS::Realm* realm); diff --git a/js/xpconnect/tests/chrome/bug503926.xul b/js/xpconnect/tests/chrome/bug503926.xhtml similarity index 100% rename from js/xpconnect/tests/chrome/bug503926.xul rename to js/xpconnect/tests/chrome/bug503926.xhtml diff --git a/js/xpconnect/tests/chrome/chrome.ini b/js/xpconnect/tests/chrome/chrome.ini index 9985686aa8..fdce22f39c 100644 --- a/js/xpconnect/tests/chrome/chrome.ini +++ b/js/xpconnect/tests/chrome/chrome.ini @@ -1,11 +1,10 @@ [DEFAULT] skip-if = os == 'android' support-files = - bug503926.xul + bug503926.xhtml file_bug484459.html - file_bug618176.xul + file_bug618176.xhtml file_bug996069.html - file_bug1050049.xml file_bug1281071.html file_discardSystemSource.html file_empty.html @@ -22,7 +21,6 @@ support-files = !/js/xpconnect/tests/mochitest/file_bug738244.html !/js/xpconnect/tests/mochitest/file_bug760131.html !/js/xpconnect/tests/mochitest/file_bug795275.html - !/js/xpconnect/tests/mochitest/file_bug795275.xml !/js/xpconnect/tests/mochitest/file_bug799348.html !/js/xpconnect/tests/mochitest/file_bug860494.html !/js/xpconnect/tests/mochitest/file_documentdomain.html @@ -37,92 +35,91 @@ prefs = javascript.options.experimental.private_fields=true javascript.options.large_arraybuffers=true -[test_APIExposer.xul] -[test_bug361111.xul] -[test_bug448587.xul] -[test_bug484459.xul] +[test_APIExposer.xhtml] +[test_bug361111.xhtml] +[test_bug448587.xhtml] +[test_bug484459.xhtml] skip-if = os == 'win' || os == 'mac' || (os == 'linux' && !debug) # bug 1131110, 1255284 -[test_bug500931.xul] -[test_bug503926.xul] -[test_bug533596.xul] -[test_bug571849.xul] -[test_bug596580.xul] -[test_bug610390.xul] -[test_bug614757.xul] -[test_bug616992.xul] -[test_bug618176.xul] -[test_bug654370.xul] -[test_bug658560.xul] -[test_bug658909.xul] -[test_bug664689.xul] -[test_bug679861.xul] -[test_bug706301.xul] -[test_bug726949.xul] -[test_bug732665.xul] -[test_bug738244.xul] -[test_bug743843.xul] -[test_bug760076.xul] +[test_bug500931.xhtml] +[test_bug503926.xhtml] +[test_bug533596.xhtml] +[test_bug571849.xhtml] +[test_bug596580.xhtml] +[test_bug610390.xhtml] +[test_bug614757.xhtml] +[test_bug616992.xhtml] +[test_bug618176.xhtml] +[test_bug654370.xhtml] +[test_bug658560.xhtml] +[test_bug658909.xhtml] +[test_bug664689.xhtml] +[test_bug679861.xhtml] +[test_bug706301.xhtml] +[test_bug726949.xhtml] +[test_bug732665.xhtml] +[test_bug738244.xhtml] +[test_bug743843.xhtml] +[test_bug760076.xhtml] [test_bug760131.html] -[test_bug763343.xul] -[test_bug771429.xul] -[test_bug773962.xul] -[test_bug792280.xul] -[test_bug793433.xul] -[test_bug795275.xul] -[test_bug799348.xul] -[test_bug801241.xul] -[test_bug812415.xul] -[test_bug853283.xul] -[test_bug853571.xul] -[test_bug858101.xul] -[test_bug860494.xul] -[test_bug865948.xul] -[test_bug866823.xul] -[test_bug895340.xul] -[test_bug932906.xul] -[test_bug996069.xul] -[test_bug1041626.xul] -[test_bug1042436.xul] -[test_bug1050049.html] +[test_bug763343.xhtml] +[test_bug771429.xhtml] +[test_bug773962.xhtml] +[test_bug792280.xhtml] +[test_bug793433.xhtml] +[test_bug795275.xhtml] +[test_bug799348.xhtml] +[test_bug801241.xhtml] +[test_bug812415.xhtml] +[test_bug853283.xhtml] +[test_bug853571.xhtml] +[test_bug858101.xhtml] +[test_bug860494.xhtml] +[test_bug865948.xhtml] +[test_bug866823.xhtml] +[test_bug895340.xhtml] +[test_bug932906.xhtml] +[test_bug996069.xhtml] +[test_bug1041626.xhtml] +[test_bug1042436.xhtml] [test_bug1065185.html] [test_bug1074863.html] -[test_bug1092477.xul] +[test_bug1092477.xhtml] [test_bug1124898.html] [test_bug1126911.html] -[test_bug1281071.xul] -[test_bug1390159.xul] +[test_bug1281071.xhtml] +[test_bug1390159.xhtml] [test_bug1430164.html] [test_bug1516237.html] -[test_chrometoSource.xul] -[test_cloneInto.xul] -[test_cows.xul] +[test_chrometoSource.xhtml] +[test_cloneInto.xhtml] +[test_cows.xhtml] [test_private_field_cows.xhtml] -[test_discardSystemSource.xul] -[test_documentdomain.xul] -[test_doublewrappedcompartments.xul] -[test_evalInSandbox.xul] -[test_evalInWindow.xul] -[test_exnstack.xul] -[test_expandosharing.xul] -[test_exposeInDerived.xul] -[test_localstorage_with_nsEp.xul] -[test_matches.xul] -[test_nodelists.xul] +[test_discardSystemSource.xhtml] +[test_documentdomain.xhtml] +[test_doublewrappedcompartments.xhtml] +[test_evalInSandbox.xhtml] +[test_evalInWindow.xhtml] +[test_exnstack.xhtml] +[test_expandosharing.xhtml] +[test_exposeInDerived.xhtml] +[test_localstorage_with_nsEp.xhtml] +[test_matches.xhtml] +[test_nodelists.xhtml] [test_nsScriptErrorWithStack.html] [test_onGarbageCollection.html] -[test_precisegc.xul] -[test_sandboxImport.xul] -[test_scriptSettings.xul] +[test_precisegc.xhtml] +[test_sandboxImport.xhtml] +[test_scriptSettings.xhtml] [test_scripterror.html] [test_sharedChromeCompartment.html] -[test_weakmap_keys_preserved.xul] -[test_weakmap_keys_preserved2.xul] -[test_weakref.xul] +[test_weakmap_keys_preserved.xhtml] +[test_weakmap_keys_preserved2.xhtml] +[test_weakref.xhtml] [test_windowProxyDeadWrapper.html] -[test_wrappers.xul] -[test_xrayic.xul] +[test_wrappers.xhtml] +[test_xrayic.xhtml] [test_xrayLargeTypedArray.html] skip-if = bits == 32 # Large ArrayBuffers not supported on 32-bit. -[test_xrayToJS.xul] +[test_xrayToJS.xhtml] [test_bug1530146.html] support-files = file_bug1530146.html file_bug1530146_inner.html diff --git a/js/xpconnect/tests/chrome/file_bug1050049.xml b/js/xpconnect/tests/chrome/file_bug1050049.xml deleted file mode 100644 index cc8653ea63..0000000000 --- a/js/xpconnect/tests/chrome/file_bug1050049.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - Anonymous Paragraph - - - Anonymous Paragraph - - diff --git a/js/xpconnect/tests/chrome/file_bug618176.xul b/js/xpconnect/tests/chrome/file_bug618176.xhtml similarity index 100% rename from js/xpconnect/tests/chrome/file_bug618176.xul rename to js/xpconnect/tests/chrome/file_bug618176.xhtml diff --git a/js/xpconnect/tests/chrome/test_APIExposer.xul b/js/xpconnect/tests/chrome/test_APIExposer.xhtml similarity index 100% rename from js/xpconnect/tests/chrome/test_APIExposer.xul rename to js/xpconnect/tests/chrome/test_APIExposer.xhtml diff --git a/js/xpconnect/tests/chrome/test_bug1041626.xul b/js/xpconnect/tests/chrome/test_bug1041626.xhtml similarity index 100% rename from js/xpconnect/tests/chrome/test_bug1041626.xul rename to js/xpconnect/tests/chrome/test_bug1041626.xhtml diff --git a/js/xpconnect/tests/chrome/test_bug1042436.xul b/js/xpconnect/tests/chrome/test_bug1042436.xhtml similarity index 100% rename from js/xpconnect/tests/chrome/test_bug1042436.xul rename to js/xpconnect/tests/chrome/test_bug1042436.xhtml diff --git a/js/xpconnect/tests/chrome/test_bug1050049.html b/js/xpconnect/tests/chrome/test_bug1050049.html deleted file mode 100644 index 74b349b4c1..0000000000 --- a/js/xpconnect/tests/chrome/test_bug1050049.html +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - Test for Bug 1050049 - - - - - - -Mozilla Bug 1050049 -

- -
-
- - - diff --git a/js/xpconnect/tests/chrome/test_bug1092477.xul b/js/xpconnect/tests/chrome/test_bug1092477.xhtml similarity index 100% rename from js/xpconnect/tests/chrome/test_bug1092477.xul rename to js/xpconnect/tests/chrome/test_bug1092477.xhtml diff --git a/js/xpconnect/tests/chrome/test_bug1281071.xul b/js/xpconnect/tests/chrome/test_bug1281071.xhtml similarity index 100% rename from js/xpconnect/tests/chrome/test_bug1281071.xul rename to js/xpconnect/tests/chrome/test_bug1281071.xhtml diff --git a/js/xpconnect/tests/chrome/test_bug1390159.xul b/js/xpconnect/tests/chrome/test_bug1390159.xhtml similarity index 100% rename from js/xpconnect/tests/chrome/test_bug1390159.xul rename to js/xpconnect/tests/chrome/test_bug1390159.xhtml diff --git a/js/xpconnect/tests/chrome/test_bug361111.xul b/js/xpconnect/tests/chrome/test_bug361111.xhtml similarity index 100% rename from js/xpconnect/tests/chrome/test_bug361111.xul rename to js/xpconnect/tests/chrome/test_bug361111.xhtml diff --git a/js/xpconnect/tests/chrome/test_bug448587.xul b/js/xpconnect/tests/chrome/test_bug448587.xhtml similarity index 94% rename from js/xpconnect/tests/chrome/test_bug448587.xul rename to js/xpconnect/tests/chrome/test_bug448587.xhtml index 7d37e9f19c..cedab9ebbd 100644 --- a/js/xpconnect/tests/chrome/test_bug448587.xul +++ b/js/xpconnect/tests/chrome/test_bug448587.xhtml @@ -18,7 +18,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=448587.xul diff --git a/js/xpconnect/tests/chrome/test_bug654370.xul b/js/xpconnect/tests/chrome/test_bug654370.xhtml similarity index 100% rename from js/xpconnect/tests/chrome/test_bug654370.xul rename to js/xpconnect/tests/chrome/test_bug654370.xhtml diff --git a/js/xpconnect/tests/chrome/test_bug658560.xul b/js/xpconnect/tests/chrome/test_bug658560.xhtml similarity index 100% rename from js/xpconnect/tests/chrome/test_bug658560.xul rename to js/xpconnect/tests/chrome/test_bug658560.xhtml diff --git a/js/xpconnect/tests/chrome/test_bug658909.xul b/js/xpconnect/tests/chrome/test_bug658909.xhtml similarity index 100% rename from js/xpconnect/tests/chrome/test_bug658909.xul rename to js/xpconnect/tests/chrome/test_bug658909.xhtml diff --git a/js/xpconnect/tests/chrome/test_bug664689.xul b/js/xpconnect/tests/chrome/test_bug664689.xhtml similarity index 100% rename from js/xpconnect/tests/chrome/test_bug664689.xul rename to js/xpconnect/tests/chrome/test_bug664689.xhtml diff --git a/js/xpconnect/tests/chrome/test_bug679861.xul b/js/xpconnect/tests/chrome/test_bug679861.xhtml similarity index 100% rename from js/xpconnect/tests/chrome/test_bug679861.xul rename to js/xpconnect/tests/chrome/test_bug679861.xhtml diff --git a/js/xpconnect/tests/chrome/test_bug706301.xul b/js/xpconnect/tests/chrome/test_bug706301.xhtml similarity index 100% rename from js/xpconnect/tests/chrome/test_bug706301.xul rename to js/xpconnect/tests/chrome/test_bug706301.xhtml diff --git a/js/xpconnect/tests/chrome/test_bug720619.xul b/js/xpconnect/tests/chrome/test_bug720619.xhtml similarity index 100% rename from js/xpconnect/tests/chrome/test_bug720619.xul rename to js/xpconnect/tests/chrome/test_bug720619.xhtml diff --git a/js/xpconnect/tests/chrome/test_bug726949.xul b/js/xpconnect/tests/chrome/test_bug726949.xhtml similarity index 100% rename from js/xpconnect/tests/chrome/test_bug726949.xul rename to js/xpconnect/tests/chrome/test_bug726949.xhtml diff --git a/js/xpconnect/tests/chrome/test_bug732665.xul b/js/xpconnect/tests/chrome/test_bug732665.xhtml similarity index 100% rename from js/xpconnect/tests/chrome/test_bug732665.xul rename to js/xpconnect/tests/chrome/test_bug732665.xhtml diff --git a/js/xpconnect/tests/chrome/test_bug738244.xul b/js/xpconnect/tests/chrome/test_bug738244.xhtml similarity index 100% rename from js/xpconnect/tests/chrome/test_bug738244.xul rename to js/xpconnect/tests/chrome/test_bug738244.xhtml diff --git a/js/xpconnect/tests/chrome/test_bug743843.xul b/js/xpconnect/tests/chrome/test_bug743843.xhtml similarity index 100% rename from js/xpconnect/tests/chrome/test_bug743843.xul rename to js/xpconnect/tests/chrome/test_bug743843.xhtml diff --git a/js/xpconnect/tests/chrome/test_bug760076.xul b/js/xpconnect/tests/chrome/test_bug760076.xhtml similarity index 100% rename from js/xpconnect/tests/chrome/test_bug760076.xul rename to js/xpconnect/tests/chrome/test_bug760076.xhtml diff --git a/js/xpconnect/tests/chrome/test_bug763343.xul b/js/xpconnect/tests/chrome/test_bug763343.xhtml similarity index 100% rename from js/xpconnect/tests/chrome/test_bug763343.xul rename to js/xpconnect/tests/chrome/test_bug763343.xhtml diff --git a/js/xpconnect/tests/chrome/test_bug771429.xul b/js/xpconnect/tests/chrome/test_bug771429.xhtml similarity index 100% rename from js/xpconnect/tests/chrome/test_bug771429.xul rename to js/xpconnect/tests/chrome/test_bug771429.xhtml diff --git a/js/xpconnect/tests/chrome/test_bug773962.xul b/js/xpconnect/tests/chrome/test_bug773962.xhtml similarity index 100% rename from js/xpconnect/tests/chrome/test_bug773962.xul rename to js/xpconnect/tests/chrome/test_bug773962.xhtml diff --git a/js/xpconnect/tests/chrome/test_bug792280.xul b/js/xpconnect/tests/chrome/test_bug792280.xhtml similarity index 100% rename from js/xpconnect/tests/chrome/test_bug792280.xul rename to js/xpconnect/tests/chrome/test_bug792280.xhtml diff --git a/js/xpconnect/tests/chrome/test_bug793433.xul b/js/xpconnect/tests/chrome/test_bug793433.xhtml similarity index 100% rename from js/xpconnect/tests/chrome/test_bug793433.xul rename to js/xpconnect/tests/chrome/test_bug793433.xhtml diff --git a/js/xpconnect/tests/chrome/test_bug795275.xul b/js/xpconnect/tests/chrome/test_bug795275.xhtml similarity index 94% rename from js/xpconnect/tests/chrome/test_bug795275.xul rename to js/xpconnect/tests/chrome/test_bug795275.xhtml index 2786ca1839..1e87c7984c 100644 --- a/js/xpconnect/tests/chrome/test_bug795275.xul +++ b/js/xpconnect/tests/chrome/test_bug795275.xhtml @@ -65,8 +65,6 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=795275 getWin('frame2').touchInterfaces(); getWin('frame4').touchComponents(); getWin('frame4').touchInterfaces(); - // This should warn twice. - getWin('frame5').touchViaXBL(); // Warnings are dispatched async, so stick ourselves at the end of the event // queue. @@ -75,7 +73,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=795275 function done() { gConsoleService.unregisterListener(gListener); - is(gWarnings, 5, "Got the right number of warnings"); + is(gWarnings, 3, "Got the right number of warnings"); SimpleTest.finish(); } @@ -86,6 +84,5 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=795275