This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
JSCLASS_GLOBAL_FLAGS | |
<- a few in js/src/shell (don't care) | |
<- a few in js/src/jsapi-tests (don't care) | |
<- "global" (startupcache/test/TestStartupCache.cpp:417; don't care) | |
<- "JSDGlobal" (js/jsd/jsd_high.c; don't care) | |
<- "jdummy" (jsapi.cpp JS_EnterCrossCompartmentCallScript; only used by JSD I think; don't care) | |
<- "IndexedDBTransactionThreadGlobal" (dom/indexedDB/IDBObjectStore.cpp:2476; don't care) | |
used in ThreadLocalJSRuntime::Init. Gets its own runtime and compartment. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/js/src/jscntxt.h b/js/src/jscntxt.h | |
--- a/js/src/jscntxt.h | |
+++ b/js/src/jscntxt.h | |
@@ -178,16 +178,23 @@ struct ConservativeGCData | |
} | |
#endif | |
bool hasStackToScan() const { | |
return !!nativeStackTop; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/js/src/shell/js.cpp b/js/src/shell/js.cpp | |
--- a/js/src/shell/js.cpp | |
+++ b/js/src/shell/js.cpp | |
@@ -843,17 +843,32 @@ Evaluate(JSContext *cx, unsigned argc, j | |
return false; | |
if ((JS_GetClass(thisobj)->flags & JSCLASS_IS_GLOBAL) != JSCLASS_IS_GLOBAL) { | |
JS_ReportErrorNumber(cx, js_GetErrorMessage, NULL, JSMSG_UNEXPECTED_TYPE, | |
"this-value passed to evaluate()", "not a global object"); | |
return false; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* This is a JavaScript Scratchpad. | |
* | |
* Enter some JavaScript, then Right Click or choose from the Execute Menu: | |
* 1. Run to evaluate the selected text, | |
* 2. Inspect to bring up an Object Inspector on the result, or, | |
* 3. Display to insert the result in a comment after the selection. | |
*/ | |
function wrap(val) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Components.utils.import("resource://gre/modules/AddonManager.jsm", null); //Getting Info of all addons & their URLS... | |
AddonManager.getAllAddons(function(addons) { | |
var s = ''; | |
for (var addon of addons) { | |
if (addon.type == 'extension') | |
s += addon.getResourceURI().spec + '\n'; | |
} | |
alert(s); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Components.utils.import("resource://gre/modules/AddonManager.jsm"); | |
AddonManager.getAllAddons(function(addons) { | |
var s = addons.length + " addons\n=====\n"; | |
for (var i = 0; i < addons.length; i++) { | |
var addon = addons[i]; | |
s += addon.type + " " + addon.name + "\n"; | |
} | |
alert(s); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This is the code that goes with this screencast: https://www.youtube.com/watch?v=mT-6IQB4vi4 | |
var win = gBrowser.selectedBrowser.contentWindow; | |
var doc = win.document; | |
var output = doc.createElement("div"); | |
output.id = "output"; | |
doc.body.appendChild(output); | |
var style = doc.createElement("style"); | |
style.innerHTML = "div#output { margin-top: 10em; white-space: pre; } div#output span { padding: 0.6em; margin: 0 0.6em; border: 1px solid rgba(0, 0, 0, 0.8); border-radius: 0.2em; box-shadow: 1px 1px 1px rgba(0, 0, 0, 0.4); position: relative; bottom: 1em; background-color: #ff5454; } div#output span > span { background-color: #ffa054; } div#output span > span > span { background-color: #ffff54; } div#output span > span > span > span { background-color: #8cd446; } div#output span > span > span > span > span { background-color: #45d2b0; } div#output span > span > span > span > span > span { background-color: #438ccb; } div#output span > span > span > span > span > span > span { background-color: #8c3fc0; } div#o |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/js/src/shell/js.cpp b/js/src/shell/js.cpp | |
--- a/js/src/shell/js.cpp | |
+++ b/js/src/shell/js.cpp | |
@@ -824,22 +824,22 @@ Evaluate(JSContext *cx, unsigned argc, j | |
"evaluate"); | |
return false; | |
} | |
if (!JSVAL_IS_STRING(argv[0]) || (argc == 2 && JSVAL_IS_PRIMITIVE(argv[1]))) { | |
JS_ReportErrorNumber(cx, my_GetErrorMessage, NULL, JSSMSG_INVALID_ARGS, "evaluate"); | |
return false; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Debugger.Breakpoint = function Breakpoint(dbg, url, line, handler) { | |
this._dbg = dbg; | |
this.url = url; | |
this.line = line; | |
this.onHit = handler; | |
this._scripts = null; | |
this.enabled = true; | |
}; | |
Debugger.Breakpoint.prototype.hit = function hit(frame) { | |
return this.onHit(frame); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/js/src/jsopcode.cpp b/js/src/jsopcode.cpp | |
--- a/js/src/jsopcode.cpp | |
+++ b/js/src/jsopcode.cpp | |
@@ -1045,72 +1045,71 @@ struct DecompiledOpcode | |
: text(NULL), parent(NULL), parentOffset(-1), parenthesized(false) | |
{} | |
}; | |
struct JSPrinter | |
{ |