Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 2 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 3 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 4 | |
michael@0 | 5 | "use strict"; |
michael@0 | 6 | |
michael@0 | 7 | module.metadata = { |
michael@0 | 8 | "stability": "unstable" |
michael@0 | 9 | }; |
michael@0 | 10 | |
michael@0 | 11 | let { Cc, Ci, CC } = require('chrome'); |
michael@0 | 12 | let { PlainTextConsole } = require('../console/plain-text'); |
michael@0 | 13 | let { stdout } = require('../system'); |
michael@0 | 14 | let ScriptError = CC('@mozilla.org/scripterror;1', 'nsIScriptError'); |
michael@0 | 15 | let consoleService = Cc['@mozilla.org/consoleservice;1'].getService(). |
michael@0 | 16 | QueryInterface(Ci.nsIConsoleService); |
michael@0 | 17 | |
michael@0 | 18 | // On windows dump does not writes into stdout so cfx can't read thous dumps. |
michael@0 | 19 | // To workaround this issue we write to a special file from which cfx will |
michael@0 | 20 | // read and print to the console. |
michael@0 | 21 | // For more details see: bug-673383 |
michael@0 | 22 | exports.dump = stdout.write; |
michael@0 | 23 | |
michael@0 | 24 | exports.console = new PlainTextConsole(); |
michael@0 | 25 | |
michael@0 | 26 | // Provide CommonJS `define` to allow authoring modules in a format that can be |
michael@0 | 27 | // loaded both into jetpack and into browser via AMD loaders. |
michael@0 | 28 | Object.defineProperty(exports, 'define', { |
michael@0 | 29 | // `define` is provided as a lazy getter that binds below defined `define` |
michael@0 | 30 | // function to the module scope, so that require, exports and module |
michael@0 | 31 | // variables remain accessible. |
michael@0 | 32 | configurable: true, |
michael@0 | 33 | get: function() { |
michael@0 | 34 | let sandbox = this; |
michael@0 | 35 | return function define(factory) { |
michael@0 | 36 | factory = Array.slice(arguments).pop(); |
michael@0 | 37 | factory.call(sandbox, sandbox.require, sandbox.exports, sandbox.module); |
michael@0 | 38 | } |
michael@0 | 39 | } |
michael@0 | 40 | }); |