summaryrefslogtreecommitdiffstats
path: root/js/src/jsapi-tests/testCompileScript.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/jsapi-tests/testCompileScript.cpp')
-rw-r--r--js/src/jsapi-tests/testCompileScript.cpp30
1 files changed, 8 insertions, 22 deletions
diff --git a/js/src/jsapi-tests/testCompileScript.cpp b/js/src/jsapi-tests/testCompileScript.cpp
index 45f5e8301a..ff7432b14b 100644
--- a/js/src/jsapi-tests/testCompileScript.cpp
+++ b/js/src/jsapi-tests/testCompileScript.cpp
@@ -53,9 +53,8 @@ bool testCompile() {
CHECK(buf16.init(cx, src_16.data(), src_16.length(),
JS::SourceOwnership::Borrowed));
- JS::CompilationStorage compileStorage;
RefPtr<JS::Stencil> stencil =
- CompileGlobalScriptToStencil(fc, options, buf16, compileStorage);
+ CompileGlobalScriptToStencil(fc, options, buf16);
CHECK(stencil);
CHECK(stencil->scriptExtra.size() == 1);
CHECK(stencil->scriptExtra[0].extent.sourceStart == 0);
@@ -63,7 +62,6 @@ bool testCompile() {
CHECK(stencil->scriptData.size() == 1);
CHECK(stencil->scriptData[0].hasSharedData()); // has generated bytecode
CHECK(stencil->scriptData[0].gcThingsLength == 1);
- CHECK(compileStorage.hasInput());
}
{ // 8-bit characters
@@ -71,9 +69,8 @@ bool testCompile() {
CHECK(
buf8.init(cx, src.data(), src.length(), JS::SourceOwnership::Borrowed));
- JS::CompilationStorage compileStorage;
RefPtr<JS::Stencil> stencil =
- CompileGlobalScriptToStencil(fc, options, buf8, compileStorage);
+ CompileGlobalScriptToStencil(fc, options, buf8);
CHECK(stencil);
CHECK(stencil->scriptExtra.size() == 1);
CHECK(stencil->scriptExtra[0].extent.sourceStart == 0);
@@ -81,7 +78,6 @@ bool testCompile() {
CHECK(stencil->scriptData.size() == 1);
CHECK(stencil->scriptData[0].hasSharedData()); // has generated bytecode
CHECK(stencil->scriptData[0].gcThingsLength == 1);
- CHECK(compileStorage.hasInput());
}
{ // propagates failures
@@ -90,9 +86,8 @@ bool testCompile() {
CHECK(srcBuf.init(cx, badSrc.data(), badSrc.length(),
JS::SourceOwnership::Borrowed));
- JS::CompilationStorage compileStorage;
RefPtr<JS::Stencil> stencil =
- CompileGlobalScriptToStencil(fc, options, srcBuf, compileStorage);
+ CompileGlobalScriptToStencil(fc, options, srcBuf);
CHECK(!stencil);
CHECK(fc->maybeError().isSome());
const js::CompileError& error = fc->maybeError().ref();
@@ -120,9 +115,8 @@ bool testNonsyntacticCompile() {
auto destroyFc =
mozilla::MakeScopeExit([fc] { JS::DestroyFrontendContext(fc); });
- JS::CompilationStorage compileStorage;
RefPtr<JS::Stencil> stencil =
- CompileGlobalScriptToStencil(fc, options, srcBuf, compileStorage);
+ CompileGlobalScriptToStencil(fc, options, srcBuf);
CHECK(stencil);
JS::InstantiateOptions instantiateOptions(options);
@@ -153,9 +147,8 @@ bool testCompileModule() {
CHECK(buf16.init(cx, src_16.data(), src_16.length(),
JS::SourceOwnership::Borrowed));
- JS::CompilationStorage compileStorage;
RefPtr<JS::Stencil> stencil =
- CompileModuleScriptToStencil(fc, options, buf16, compileStorage);
+ CompileModuleScriptToStencil(fc, options, buf16);
CHECK(stencil);
CHECK(stencil->isModule());
CHECK(stencil->scriptExtra.size() == 1);
@@ -164,7 +157,6 @@ bool testCompileModule() {
CHECK(stencil->scriptData.size() == 1);
CHECK(stencil->scriptData[0].hasSharedData()); // has generated bytecode
CHECK(stencil->scriptData[0].gcThingsLength == 1);
- CHECK(compileStorage.hasInput());
}
{ // 8-bit characters
@@ -172,9 +164,8 @@ bool testCompileModule() {
CHECK(
buf8.init(cx, src.data(), src.length(), JS::SourceOwnership::Borrowed));
- JS::CompilationStorage compileStorage;
RefPtr<JS::Stencil> stencil =
- CompileModuleScriptToStencil(fc, options, buf8, compileStorage);
+ CompileModuleScriptToStencil(fc, options, buf8);
CHECK(stencil);
CHECK(stencil->scriptExtra.size() == 1);
CHECK(stencil->scriptExtra[0].extent.sourceStart == 0);
@@ -182,7 +173,6 @@ bool testCompileModule() {
CHECK(stencil->scriptData.size() == 1);
CHECK(stencil->scriptData[0].hasSharedData()); // has generated bytecode
CHECK(stencil->scriptData[0].gcThingsLength == 1);
- CHECK(compileStorage.hasInput());
}
{ // propagates failures
@@ -191,9 +181,8 @@ bool testCompileModule() {
CHECK(srcBuf.init(cx, badSrc.data(), badSrc.length(),
JS::SourceOwnership::Borrowed));
- JS::CompilationStorage compileStorage;
RefPtr<JS::Stencil> stencil =
- CompileModuleScriptToStencil(fc, options, srcBuf, compileStorage);
+ CompileModuleScriptToStencil(fc, options, srcBuf);
CHECK(!stencil);
CHECK(fc->maybeError().isSome());
const js::CompileError& error = fc->maybeError().ref();
@@ -220,15 +209,12 @@ bool testPrepareForInstantiate() {
auto destroyFc =
mozilla::MakeScopeExit([fc] { JS::DestroyFrontendContext(fc); });
- JS::CompilationStorage compileStorage;
RefPtr<JS::Stencil> stencil =
- CompileGlobalScriptToStencil(fc, options, buf16, compileStorage);
+ CompileGlobalScriptToStencil(fc, options, buf16);
CHECK(stencil);
CHECK(stencil->scriptData.size() == 2);
CHECK(stencil->scopeData.size() == 1); // function f
CHECK(stencil->parserAtomData.size() == 1); // 'field'
- CHECK(compileStorage.hasInput());
- CHECK(compileStorage.getInput().atomCache.empty());
JS::InstantiationStorage storage;
CHECK(JS::PrepareForInstantiate(fc, *stencil, storage));