Bug 1263882: Set a default value in DescribeScriptedCaller if the filename is null; r=luke
authorBenjamin Bouvier <benj@benj.me>
Mon, 18 Apr 2016 16:47:25 +0200
changeset 331487 754df2bac0649206fc1071b1a218fe501fa88cdc
parent 331486 8cadd52cac62c70d310a1c1dbf176f58c7e87a6f
child 331488 c2239c623e86840b10786c0595c23844ec0ee296
push id6048
push userkmoir@mozilla.com
push dateMon, 06 Jun 2016 19:02:08 +0000
treeherdermozilla-beta@46d72a56c57d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersluke
bugs1263882
milestone48.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1263882: Set a default value in DescribeScriptedCaller if the filename is null; r=luke MozReview-Commit-ID: KTJGoH8KEAc
js/src/jit-test/tests/wasm/basic.js
js/src/jsapi.cpp
--- a/js/src/jit-test/tests/wasm/basic.js
+++ b/js/src/jit-test/tests/wasm/basic.js
@@ -353,16 +353,19 @@ var code = '(module (import "one" "" (re
 var imports = {one:()=>1, two:()=>2};
 assertEq(wasmEvalText(code.replace('BODY', '(call_import 0)'), imports)(), 1);
 assertEq(wasmEvalText(code.replace('BODY', '(call_import 1)'), imports)(), 2);
 assertEq(wasmEvalText(code.replace('BODY', '(call 0)'), imports)(), 3);
 assertEq(wasmEvalText(code.replace('BODY', '(call 1)'), imports)(), 4);
 
 assertEq(wasmEvalText(`(module (import "evalcx" "" (param i32) (result i32)) (func (result i32) (call_import 0 (i32.const 0))) (export "" 0))`, {evalcx})(), 0);
 
+if (typeof evaluate === 'function')
+    evaluate(`Wasm.instantiateModule(wasmTextToBinary('(module)')) `, { fileName: null });
+
 if (hasI64()) {
     assertErrorMessage(() => wasmEvalText('(module (import "a" "" (param i64) (result i32)))'), TypeError, /i64 argument/);
     assertErrorMessage(() => wasmEvalText('(module (import "a" "" (result i64)))'), TypeError, /i64 return type/);
 
     setJitCompilerOption('wasm.test-mode', 1);
 
     let imp = {
         param(i64) {
--- a/js/src/jsapi.cpp
+++ b/js/src/jsapi.cpp
@@ -6272,17 +6272,17 @@ void AutoFilename::setScriptSource(js::S
         p->incref();
         setUnowned(p->filename());
     }
 }
 
 void AutoFilename::setUnowned(const char* filename)
 {
     MOZ_ASSERT(!get());
-    filename_.as<const char*>() = filename;
+    filename_.as<const char*>() = filename ? filename : "";
 }
 
 void AutoFilename::setOwned(UniqueChars&& filename)
 {
     MOZ_ASSERT(!get());
     filename_ = AsVariant(Move(filename));
 }