From 4f4b68dc9cfc9c950e4ea166d49505299107b1a3 Mon Sep 17 00:00:00 2001 From: Jeff Walden Date: Wed, 10 Apr 2019 10:19:00 -0700 Subject: [PATCH] Bug 1543458 - Compile UTF-8 files in jsapi-tests without inflating to UTF-16. r=arai Differential Revision: https://phabricator.services.mozilla.com/D26957 --HG-- extra : rebase_source : c87123cf49f42ae02fd3418648ad3c3232b63ff0 --- js/src/jsapi-tests/testScriptObject.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/js/src/jsapi-tests/testScriptObject.cpp b/js/src/jsapi-tests/testScriptObject.cpp index c82f296bd8ae..a567040917fb 100644 --- a/js/src/jsapi-tests/testScriptObject.cpp +++ b/js/src/jsapi-tests/testScriptObject.cpp @@ -7,7 +7,7 @@ #include "mozilla/Utf8.h" // mozilla::Utf8Unit -#include "js/CompilationAndEvaluation.h" // JS::Compile{,DontInflate,Utf8{Path,File}} +#include "js/CompilationAndEvaluation.h" // JS::Compile{,DontInflate,Utf8{FileDontInflate,Path}} #include "js/SourceText.h" // JS::Source{Ownership,Text} #include "jsapi-tests/tests.h" @@ -171,7 +171,8 @@ BEGIN_FIXTURE_TEST(ScriptObjectFixture, bug438633_JS_CompileFileHandle) { JS::CompileOptions options(cx); options.setFileAndLine("temporary file", 1); - JS::RootedScript script(cx, JS::CompileUtf8File(cx, options, script_stream)); + JS::RootedScript script( + cx, JS::CompileUtf8FileDontInflate(cx, options, script_stream)); CHECK(script); return tryScript(script); @@ -186,7 +187,8 @@ BEGIN_FIXTURE_TEST(ScriptObjectFixture, bug438633_JS_CompileFileHandle_empty) { JS::CompileOptions options(cx); options.setFileAndLine("empty temporary file", 1); - JS::RootedScript script(cx, JS::CompileUtf8File(cx, options, script_stream)); + JS::RootedScript script( + cx, JS::CompileUtf8FileDontInflate(cx, options, script_stream)); CHECK(script); return tryScript(script); @@ -204,7 +206,8 @@ BEGIN_FIXTURE_TEST(ScriptObjectFixture, JS::CompileOptions options(cx); options.setFileAndLine("temporary file", 1); - JS::RootedScript script(cx, JS::CompileUtf8File(cx, options, script_stream)); + JS::RootedScript script( + cx, JS::CompileUtf8FileDontInflate(cx, options, script_stream)); CHECK(script); return tryScript(script);