Skip to content

Commit

Permalink
Use the latest available JS engine when running scripts.
Browse files Browse the repository at this point in the history
Fixes #1403
  • Loading branch information
Anthony Lieuallen committed Aug 29, 2011
1 parent 6075b0c commit 1dcb930
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions components/greasemonkey.js
Expand Up @@ -25,7 +25,9 @@ var gExtensionPath = (function() {
} catch (e) { dump(e+'\n'+uneval(e)+'\n\n'); return 'x'; }
})();

var gMaxJSVersion = "1.6";
// Only a particular set of strings are allowed. See: http://goo.gl/ex2LJ
var gMaxJSVersion = "1.8";

var gMenuCommands = [];
var gStartupHasRun = false;

Expand Down Expand Up @@ -272,9 +274,8 @@ function startup() {
loader.loadSubScript("chrome://greasemonkey/content/scriptdownloader.js");
loader.loadSubScript("chrome://greasemonkey/content/third-party/mpl-utils.js");

// Firefox 3.6 and higher supports 1.8.
if (GM_util.compareFirefoxVersion("3.6") >= 0) {
gMaxJSVersion = "1.8";
if (GM_util.compareFirefoxVersion("4.0") >= 0) {
gMaxJSVersion = "ECMAv5";
}

// Firefox <4 reports a different stack.fileName for the module.
Expand Down

0 comments on commit 1dcb930

Please sign in to comment.