Bug 935366 - Fix b2g scope issue in sourcemap xpcshell tests. r=fitzgen
authorAlexandre Poirot <poirot.alex@gmail.com>
Thu, 06 Aug 2015 09:52:29 -0700
changeset 288258 13cfa6b095a04f98b2e7fcace86856431c7b7503
parent 288257 2c12a07e083403d5037c881fefc4f31de78e178d
child 288259 1a75b4e0ac8bdd87f54adda611fe99127174c749
push id5067
push userraliiev@mozilla.com
push dateMon, 21 Sep 2015 14:04:52 +0000
treeherdermozilla-beta@14221ffe5b2f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfitzgen
bugs935366
milestone42.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 935366 - Fix b2g scope issue in sourcemap xpcshell tests. r=fitzgen
toolkit/devtools/sourcemap/source-map.js
toolkit/devtools/sourcemap/tests/unit/Utils.jsm
--- a/toolkit/devtools/sourcemap/source-map.js
+++ b/toolkit/devtools/sourcemap/source-map.js
@@ -3027,16 +3027,19 @@ define('source-map/source-node', ['requi
   };
 
   exports.SourceNode = SourceNode;
 
 });
 /* -*- Mode: js; js-indent-level: 2; -*- */
 ///////////////////////////////////////////////////////////////////////////////
 
+this.define = define;
+this.require = require;
+
 this.sourceMap = {
   SourceMapConsumer: require('source-map/source-map-consumer').SourceMapConsumer,
   SourceMapGenerator: require('source-map/source-map-generator').SourceMapGenerator,
   SourceNode: require('source-map/source-node').SourceNode
 };
 if (typeof module === "object" && module && module.exports) {
   module.exports = this.sourceMap;
 }
--- a/toolkit/devtools/sourcemap/tests/unit/Utils.jsm
+++ b/toolkit/devtools/sourcemap/tests/unit/Utils.jsm
@@ -9,17 +9,23 @@
  * WARNING!
  *
  * Do not edit this file directly, it is built from the sources at
  * https://github.com/mozilla/source-map/
  */
 
 let loader = Components.classes["@mozilla.org/moz/jssubscript-loader;1"]
   .getService(Components.interfaces.mozIJSSubScriptLoader);
-loader.loadSubScript("resource://gre/modules/devtools/sourcemap/source-map.js", this);
+let exports = {};
+loader.loadSubScript("resource://gre/modules/devtools/sourcemap/source-map.js", exports);
+
+// Also bind on `this` for b2g bug on EXPORTED_SYMBOLS
+let define = this.define = exports.define;
+
+let require = exports.require;
 
 this.EXPORTED_SYMBOLS = [ "define", "runSourceMapTests" ];
 /* -*- Mode: js; js-indent-level: 2; -*- */
 /*
  * Copyright 2011 Mozilla Foundation and contributors
  * Licensed under the New BSD license. See LICENSE or:
  * http://opensource.org/licenses/BSD-3-Clause
  */