Files
firefox/devtools/client/shared/test/browser_require_raw.js
T
Alexandre Poirot e689948770 Bug 1303288 - Pass the window object instead of current scope to prevent wrapper issues when using the devtools reload addon. r=jlongster
If we happen to pass the current scope (`this`), the browser-loader codebase fails
when passing it as sandboxPrototype. It only works when passing an xray wrapper.
The document scope happen to not be an xray when using the addon, whereas `window`
always is no matter if we are using the addon or not.

MozReview-Commit-ID: GjYHkaCGBDd
2016-09-21 08:07:02 -07:00

21 lines
617 B
JavaScript

/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
/* vim: set ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
const { BrowserLoader } = Cu.import("resource://devtools/client/shared/browser-loader.js", {});
const { require: browserRequire } = BrowserLoader({
baseURI: "resource://devtools/client/shared/",
window
});
const variableFileContents = browserRequire("raw!devtools/client/themes/variables.css");
function test() {
ok(variableFileContents.length > 0, "raw browserRequire worked");
finish();
}