author | Jeff Walden <jwalden@mit.edu> |
Sun, 23 Jan 2011 03:12:28 -0800 | |
changeset 61225 | a7d178f043dbc420c38e1bdd8f62453745c94572 |
parent 61224 | b2024811aea7dcb7a7145ca6221da1172d0b96d4 |
child 61226 | 46b9f2a8343b45dc4b59a5bad97ce6db280ddab6 |
push id | unknown |
push user | unknown |
push date | unknown |
reviewers | return-to-sanity |
milestone | 2.0b10pre |
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
|
--- a/browser/base/content/syncSetup.js +++ b/browser/base/content/syncSetup.js @@ -875,19 +875,19 @@ var gSyncSetup = { return true; }, // sets class and string on a feedback element // if no property string is passed in, we clear label/style _setFeedback: function (element, success, string) { element.hidden = success || !string; - let classname = success ? "success" : "error"; + let class = success ? "success" : "error"; let image = element.getElementsByAttribute("class", "statusIcon")[0]; - image.setAttribute("status", classname); + image.setAttribute("status", class); let label = element.getElementsByAttribute("class", "status")[0]; label.value = string; }, // shim _setFeedbackMessage: function (element, success, string) { let str = ""; if (string) {
--- a/browser/components/nsBrowserGlue.js +++ b/browser/components/nsBrowserGlue.js @@ -141,19 +141,19 @@ BrowserGlue.prototype = { if (prefDelay > 0) return; } // delays are in seconds const MAX_DELAY = 300; let delay = 3; - let browserEnum = Services.wm.getEnumerator("navigator:browser"); - while (browserEnum.hasMoreElements()) { - delay += browserEnum.getNext().gBrowser.tabs.length; + let enum = Services.wm.getEnumerator("navigator:browser"); + while (enum.hasMoreElements()) { + delay += enum.getNext().gBrowser.tabs.length; } delay = delay <= MAX_DELAY ? delay : MAX_DELAY; let syncTemp = {}; Cu.import("resource://services-sync/service.js", syncTemp); syncTemp.Weave.Service.delayedAutoConnect(delay); }, #endif
--- a/browser/fuel/src/fuelApplication.js +++ b/browser/fuel/src/fuelApplication.js @@ -698,20 +698,20 @@ Application.prototype = { get bookmarks() { let bookmarks = new BookmarkRoots(); this.__defineGetter__("bookmarks", function() bookmarks); return this.bookmarks; }, get windows() { var win = []; - var browserEnum = Utilities.windowMediator.getEnumerator("navigator:browser"); + var enum = Utilities.windowMediator.getEnumerator("navigator:browser"); - while (browserEnum.hasMoreElements()) - win.push(new Window(browserEnum.getNext())); + while (enum.hasMoreElements()) + win.push(new Window(enum.getNext())); return win; }, get activeWindow() { return new Window(Utilities.windowMediator.getMostRecentWindow("navigator:browser")); } };
--- a/content/base/test/chrome/title_window.xul +++ b/content/base/test/chrome/title_window.xul @@ -16,18 +16,18 @@ <iframe id="xul1" src="data:application/vnd.mozilla.xul+xml,<window xmlns='http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul' title='Test'/>"/> <iframe id="xul2" src="data:application/vnd.mozilla.xul+xml,<window xmlns='http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul' title='Test'/>"/> <iframe type="content" id="svg1" src="data:text/xml,<svg xmlns='http://www.w3.org/2000/svg'><title id='t'>Test</title></svg>"/> <iframe type="content" id="svg2" src="data:text/xml,<svg xmlns='http://www.w3.org/2000/svg'><title id='t'>Test</title></svg>"/> <script type="application/javascript"> <![CDATA[ var imports = [ "SimpleTest", "is", "isnot", "ok" ]; - for each (var name in imports) { - window[name] = window.opener.wrappedJSObject[name]; + for each (var import in imports) { + window[import] = window.opener.wrappedJSObject[import]; } function testStatics() { function testStatic(id, expect, description) { is(document.getElementById(id).contentDocument.title, expect, description); } testStatic("html1", "Test", "HTML <title>");
--- a/docshell/test/chrome/bug113934_window.xul +++ b/docshell/test/chrome/bug113934_window.xul @@ -10,18 +10,18 @@ </vbox> <spacer flex="1"/> </hbox> <!-- test code goes here --> <script type="application/javascript"><![CDATA[ var imports = [ "SimpleTest", "is", "isnot", "ok", "snapshotWindow", "compareSnapshots", "onerror" ]; - for each (var name in imports) { - window[name] = window.opener.wrappedJSObject[name]; + for each (var import in imports) { + window[import] = window.opener.wrappedJSObject[import]; } function $(id) { return document.getElementById(id); } function addBrowser(parent, id, width, height) { var b =
--- a/docshell/test/chrome/bug215405_window.xul +++ b/docshell/test/chrome/bug215405_window.xul @@ -42,18 +42,18 @@ xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" width="600" height="600" onload="onLoad();" title="215405 test"> <script type="application/javascript"><![CDATA[ var imports = [ "SimpleTest", "is", "isnot", "ok"]; - for each (var name in imports) { - window[name] = window.opener.wrappedJSObject[name]; + for each (var import in imports) { + window[import] = window.opener.wrappedJSObject[import]; } const text="MOZILLA"; const nostoreURI = "http://mochi.test:8888/tests/docshell/test/chrome/" + "215405_nostore.html"; const nocacheURI = "https://example.com:443/tests/docshell/test/chrome/" + "215405_nocache.html";
--- a/docshell/test/chrome/bug449778_window.xul +++ b/docshell/test/chrome/bug449778_window.xul @@ -4,18 +4,18 @@ xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <hbox id="parent"> </hbox> <!-- test code goes here --> <script type="application/javascript"><![CDATA[ var imports = [ "SimpleTest", "is", "isnot", "ok", "onerror" ]; - for each (var name in imports) { - window[name] = window.opener.wrappedJSObject[name]; + for each (var import in imports) { + window[import] = window.opener.wrappedJSObject[import]; } function $(id) { return document.getElementById(id); } function addBrowser(parent, id, width, height) { var b =
--- a/docshell/test/chrome/bug449780_window.xul +++ b/docshell/test/chrome/bug449780_window.xul @@ -4,18 +4,18 @@ xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <hbox id="parent"> </hbox> <!-- test code goes here --> <script type="application/javascript"><![CDATA[ var imports = [ "SimpleTest", "is", "isnot", "ok", "onerror" ]; - for each (var name in imports) { - window[name] = window.opener.wrappedJSObject[name]; + for each (var import in imports) { + window[import] = window.opener.wrappedJSObject[import]; } function $(id) { return document.getElementById(id); } function addBrowser(parent, id, width, height) { var b =
--- a/docshell/test/chrome/docshell_helpers.js +++ b/docshell/test/chrome/docshell_helpers.js @@ -1,15 +1,15 @@ /** * Import common SimpleTest methods so that they're usable in this window. */ var imports = [ "SimpleTest", "is", "isnot", "ok", "onerror", "todo", "todo_is", "todo_isnot" ]; -for each (var name in imports) { - window[name] = window.opener.wrappedJSObject[name]; +for each (var import in imports) { + window[import] = window.opener.wrappedJSObject[import]; } /** * Define global constants and variables. */ const NAV_NONE = 0; const NAV_BACK = 1; const NAV_FORWARD = 2;
deleted file mode 100644 --- a/js/src/jit-test/tests/basic/strict-eval-loop-error.js +++ /dev/null @@ -1,3 +0,0 @@ -var COUNT = RUNLOOP; -eval("'use strict'; for (let j = 0; j < COUNT; j++); try { x; throw new Error(); } catch (e) { if (!(e instanceof ReferenceError)) throw e; }"); -assertEq(typeof j, "undefined");
--- a/js/src/jsapi.cpp +++ b/js/src/jsapi.cpp @@ -4840,18 +4840,17 @@ JS_DecompileScript(JSContext *cx, JSScri !(indent & JS_DONT_PRETTY_PRINT), false, false); if (!jp) return NULL; if (js_DecompileScript(jp, script)) str = js_GetPrinterOutput(jp); else str = NULL; - if (!js_DestroyPrinter(jp)) - return NULL; + js_DestroyPrinter(jp); return str; } JS_PUBLIC_API(JSString *) JS_DecompileFunction(JSContext *cx, JSFunction *fun, uintN indent) { JS_THREADSAFE_ASSERT(cx->compartment != cx->runtime->atomsCompartment); CHECK_REQUEST(cx);
--- a/js/src/jsemit.cpp +++ b/js/src/jsemit.cpp @@ -7085,20 +7085,22 @@ js_EmitTree(JSContext *cx, JSCodeGenerat #if JS_HAS_XML_SUPPORT case TOK_ANYNAME: #endif case TOK_PRIMARY: if (js_Emit1(cx, cg, PN_OP(pn)) < 0) return JS_FALSE; break; +#if JS_HAS_DEBUGGER_KEYWORD case TOK_DEBUGGER: if (js_Emit1(cx, cg, JSOP_DEBUGGER) < 0) return JS_FALSE; break; +#endif /* JS_HAS_DEBUGGER_KEYWORD */ #if JS_HAS_XML_SUPPORT case TOK_XMLELEM: case TOK_XMLLIST: JS_ASSERT(PN_TYPE(pn) == TOK_XMLLIST || pn->pn_count != 0); switch (pn->pn_head ? PN_TYPE(pn->pn_head) : TOK_XMLLIST) { case TOK_XMLETAGO: JS_ASSERT(0);
--- a/js/src/jsinterp.cpp +++ b/js/src/jsinterp.cpp @@ -6254,16 +6254,17 @@ BEGIN_CASE(JSOP_INSTANCEOF) JSBool cond = JS_FALSE; if (!HasInstance(cx, obj, &lref, &cond)) goto error; regs.sp--; regs.sp[-1].setBoolean(cond); } END_CASE(JSOP_INSTANCEOF) +#if JS_HAS_DEBUGGER_KEYWORD BEGIN_CASE(JSOP_DEBUGGER) { JSDebuggerHandler handler = cx->debugHooks->debuggerHandler; if (handler) { Value rval; switch (handler(cx, script, regs.pc, Jsvalify(&rval), cx->debugHooks->debuggerHandlerData)) { case JSTRAP_ERROR: goto error; @@ -6277,16 +6278,17 @@ BEGIN_CASE(JSOP_DEBUGGER) cx->setPendingException(rval); goto error; default:; } CHECK_INTERRUPT_HANDLER(); } } END_CASE(JSOP_DEBUGGER) +#endif /* JS_HAS_DEBUGGER_KEYWORD */ #if JS_HAS_XML_SUPPORT BEGIN_CASE(JSOP_DEFXMLNS) { if (!js_SetDefaultXMLNamespace(cx, regs.sp[-1])) goto error; regs.sp--; }
--- a/js/src/jskeyword.tbl +++ b/js/src/jskeyword.tbl @@ -33,80 +33,92 @@ * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ -/* - * Keywords used as primary expressions, sharing the TOK_PRIMARY token kind, - * distinguished by opcode. - */ -JS_KEYWORD(false, TOK_PRIMARY, JSOP_FALSE, JSVERSION_DEFAULT) -JS_KEYWORD(true, TOK_PRIMARY, JSOP_TRUE, JSVERSION_DEFAULT) -JS_KEYWORD(null, TOK_PRIMARY, JSOP_NULL, JSVERSION_DEFAULT) - -/* ES5 Keywords. */ JS_KEYWORD(break, TOK_BREAK, JSOP_NOP, JSVERSION_DEFAULT) JS_KEYWORD(case, TOK_CASE, JSOP_NOP, JSVERSION_DEFAULT) -JS_KEYWORD(catch, TOK_CATCH, JSOP_NOP, JSVERSION_DEFAULT) JS_KEYWORD(continue, TOK_CONTINUE, JSOP_NOP, JSVERSION_DEFAULT) -JS_KEYWORD(debugger, TOK_DEBUGGER, JSOP_NOP, JSVERSION_DEFAULT) JS_KEYWORD(default, TOK_DEFAULT, JSOP_NOP, JSVERSION_DEFAULT) JS_KEYWORD(delete, TOK_DELETE, JSOP_NOP, JSVERSION_DEFAULT) JS_KEYWORD(do, TOK_DO, JSOP_NOP, JSVERSION_DEFAULT) JS_KEYWORD(else, TOK_ELSE, JSOP_NOP, JSVERSION_DEFAULT) -JS_KEYWORD(finally, TOK_FINALLY, JSOP_NOP, JSVERSION_DEFAULT) +JS_KEYWORD(export, TOK_RESERVED, JSOP_NOP, JSVERSION_DEFAULT) +JS_KEYWORD(false, TOK_PRIMARY, JSOP_FALSE, JSVERSION_DEFAULT) JS_KEYWORD(for, TOK_FOR, JSOP_NOP, JSVERSION_DEFAULT) JS_KEYWORD(function, TOK_FUNCTION, JSOP_NOP, JSVERSION_DEFAULT) JS_KEYWORD(if, TOK_IF, JSOP_NOP, JSVERSION_DEFAULT) JS_KEYWORD(in, TOK_IN, JSOP_IN, JSVERSION_DEFAULT) -JS_KEYWORD(instanceof, TOK_INSTANCEOF, JSOP_INSTANCEOF,JSVERSION_DEFAULT) JS_KEYWORD(new, TOK_NEW, JSOP_NEW, JSVERSION_DEFAULT) +JS_KEYWORD(null, TOK_PRIMARY, JSOP_NULL, JSVERSION_DEFAULT) JS_KEYWORD(return, TOK_RETURN, JSOP_NOP, JSVERSION_DEFAULT) JS_KEYWORD(switch, TOK_SWITCH, JSOP_NOP, JSVERSION_DEFAULT) JS_KEYWORD(this, TOK_PRIMARY, JSOP_THIS, JSVERSION_DEFAULT) -JS_KEYWORD(throw, TOK_THROW, JSOP_NOP, JSVERSION_DEFAULT) -JS_KEYWORD(try, TOK_TRY, JSOP_NOP, JSVERSION_DEFAULT) +JS_KEYWORD(true, TOK_PRIMARY, JSOP_TRUE, JSVERSION_DEFAULT) JS_KEYWORD(typeof, TOK_UNARYOP, JSOP_TYPEOF, JSVERSION_DEFAULT) JS_KEYWORD(var, TOK_VAR, JSOP_DEFVAR, JSVERSION_DEFAULT) JS_KEYWORD(void, TOK_UNARYOP, JSOP_VOID, JSVERSION_DEFAULT) JS_KEYWORD(while, TOK_WHILE, JSOP_NOP, JSVERSION_DEFAULT) JS_KEYWORD(with, TOK_WITH, JSOP_NOP, JSVERSION_DEFAULT) - -/* ES5 FutureReservedWord keywords. */ -JS_KEYWORD(class, TOK_RESERVED, JSOP_NOP, JSVERSION_DEFAULT) -JS_KEYWORD(enum, TOK_RESERVED, JSOP_NOP, JSVERSION_DEFAULT) -JS_KEYWORD(export, TOK_RESERVED, JSOP_NOP, JSVERSION_DEFAULT) -JS_KEYWORD(extends, TOK_RESERVED, JSOP_NOP, JSVERSION_DEFAULT) -JS_KEYWORD(import, TOK_RESERVED, JSOP_NOP, JSVERSION_DEFAULT) -JS_KEYWORD(super, TOK_RESERVED, JSOP_NOP, JSVERSION_DEFAULT) - -/* - * ES5 reserved keywords with long-implemented behavior, allowed in our - * implementation to ease code migration. - */ #if JS_HAS_CONST JS_KEYWORD(const, TOK_VAR, JSOP_DEFCONST, JSVERSION_DEFAULT) #else JS_KEYWORD(const, TOK_RESERVED, JSOP_NOP, JSVERSION_DEFAULT) #endif -#if JS_HAS_BLOCK_SCOPE -JS_KEYWORD(let, TOK_LET, JSOP_NOP, JSVERSION_1_7) -#else -JS_KEYWORD(let, TOK_STRICT_RESERVED, JSOP_NOP, JSVERSION_1_7) -#endif -#if JS_HAS_GENERATORS -JS_KEYWORD(yield, TOK_YIELD, JSOP_NOP, JSVERSION_1_7) -#else -JS_KEYWORD(yield, TOK_STRICT_RESERVED, JSOP_NOP, JSVERSION_1_7) + +JS_KEYWORD(try, TOK_TRY, JSOP_NOP, JSVERSION_DEFAULT) +JS_KEYWORD(catch, TOK_CATCH, JSOP_NOP, JSVERSION_DEFAULT) +JS_KEYWORD(finally, TOK_FINALLY, JSOP_NOP, JSVERSION_DEFAULT) +JS_KEYWORD(throw, TOK_THROW, JSOP_NOP, JSVERSION_DEFAULT) + +JS_KEYWORD(instanceof, TOK_INSTANCEOF, JSOP_INSTANCEOF,JSVERSION_DEFAULT) + +#if JS_HAS_RESERVED_JAVA_KEYWORDS +JS_KEYWORD(abstract, TOK_RESERVED, JSOP_NOP, JSVERSION_DEFAULT) +JS_KEYWORD(boolean, TOK_RESERVED, JSOP_NOP, JSVERSION_DEFAULT) +JS_KEYWORD(byte, TOK_RESERVED, JSOP_NOP, JSVERSION_DEFAULT) +JS_KEYWORD(char, TOK_RESERVED, JSOP_NOP, JSVERSION_DEFAULT) +JS_KEYWORD(class, TOK_RESERVED, JSOP_NOP, JSVERSION_DEFAULT) +JS_KEYWORD(double, TOK_RESERVED, JSOP_NOP, JSVERSION_DEFAULT) +JS_KEYWORD(extends, TOK_RESERVED, JSOP_NOP, JSVERSION_DEFAULT) +JS_KEYWORD(final, TOK_RESERVED, JSOP_NOP, JSVERSION_DEFAULT) +JS_KEYWORD(float, TOK_RESERVED, JSOP_NOP, JSVERSION_DEFAULT) +JS_KEYWORD(goto, TOK_RESERVED, JSOP_NOP, JSVERSION_DEFAULT) +JS_KEYWORD(implements, TOK_RESERVED, JSOP_NOP, JSVERSION_DEFAULT) +JS_KEYWORD(import, TOK_RESERVED, JSOP_NOP, JSVERSION_DEFAULT) +JS_KEYWORD(int, TOK_RESERVED, JSOP_NOP, JSVERSION_DEFAULT) +JS_KEYWORD(interface, TOK_RESERVED, JSOP_NOP, JSVERSION_DEFAULT) +JS_KEYWORD(long, TOK_RESERVED, JSOP_NOP, JSVERSION_DEFAULT) +JS_KEYWORD(native, TOK_RESERVED, JSOP_NOP, JSVERSION_DEFAULT) +JS_KEYWORD(package, TOK_RESERVED, JSOP_NOP, JSVERSION_DEFAULT) +JS_KEYWORD(private, TOK_RESERVED, JSOP_NOP, JSVERSION_DEFAULT) +JS_KEYWORD(protected, TOK_RESERVED, JSOP_NOP, JSVERSION_DEFAULT) +JS_KEYWORD(public, TOK_RESERVED, JSOP_NOP, JSVERSION_DEFAULT) +JS_KEYWORD(short, TOK_RESERVED, JSOP_NOP, JSVERSION_DEFAULT) +JS_KEYWORD(static, TOK_RESERVED, JSOP_NOP, JSVERSION_DEFAULT) +JS_KEYWORD(super, TOK_RESERVED, JSOP_NOP, JSVERSION_DEFAULT) +JS_KEYWORD(synchronized,TOK_RESERVED, JSOP_NOP, JSVERSION_DEFAULT) +JS_KEYWORD(throws, TOK_RESERVED, JSOP_NOP, JSVERSION_DEFAULT) +JS_KEYWORD(transient, TOK_RESERVED, JSOP_NOP, JSVERSION_DEFAULT) +JS_KEYWORD(volatile, TOK_RESERVED, JSOP_NOP, JSVERSION_DEFAULT) #endif -/* ES5 future reserved keywords in strict mode. */ -JS_KEYWORD(implements, TOK_STRICT_RESERVED, JSOP_NOP, JSVERSION_DEFAULT) -JS_KEYWORD(interface, TOK_STRICT_RESERVED, JSOP_NOP, JSVERSION_DEFAULT) -JS_KEYWORD(package, TOK_STRICT_RESERVED, JSOP_NOP, JSVERSION_DEFAULT) -JS_KEYWORD(private, TOK_STRICT_RESERVED, JSOP_NOP, JSVERSION_DEFAULT) -JS_KEYWORD(protected, TOK_STRICT_RESERVED, JSOP_NOP, JSVERSION_DEFAULT) -JS_KEYWORD(public, TOK_STRICT_RESERVED, JSOP_NOP, JSVERSION_DEFAULT) -JS_KEYWORD(static, TOK_STRICT_RESERVED, JSOP_NOP, JSVERSION_DEFAULT) +#if JS_HAS_RESERVED_ECMA_KEYWORDS +JS_KEYWORD(enum, TOK_RESERVED, JSOP_NOP, JSVERSION_DEFAULT) +#endif + +#if JS_HAS_DEBUGGER_KEYWORD +JS_KEYWORD(debugger, TOK_DEBUGGER, JSOP_NOP, JSVERSION_DEFAULT) +#elif JS_HAS_RESERVED_ECMA_KEYWORDS +JS_KEYWORD(debugger, TOK_RESERVED, JSOP_NOP, JSVERSION_DEFAULT) +#endif + +#if JS_HAS_GENERATORS +JS_KEYWORD(yield, TOK_YIELD, JSOP_NOP, JSVERSION_1_7) +#endif + +#if JS_HAS_BLOCK_SCOPE +JS_KEYWORD(let, TOK_LET, JSOP_NOP, JSVERSION_1_7) +#endif
--- a/js/src/jsopcode.cpp +++ b/js/src/jsopcode.cpp @@ -800,17 +800,16 @@ js_QuoteString(JSContext *cx, JSString * struct JSPrinter { Sprinter sprinter; /* base class state */ JSArenaPool pool; /* string allocation pool */ uintN indent; /* indentation in spaces */ bool pretty; /* pretty-print: indent, use newlines */ bool grouped; /* in parenthesized expression context */ bool strict; /* in code marked strict */ - bool error; /* error occured */ JSScript *script; /* script being printed */ jsbytecode *dvgfence; /* DecompileExpression fencepost */ jsbytecode **pcstack; /* DecompileExpression modeled stack */ JSFunction *fun; /* interpreted function */ jsuword *localNames; /* argument and variable names */ }; JSPrinter * @@ -823,39 +822,36 @@ js_NewPrinter(JSContext *cx, const char if (!jp) return NULL; INIT_SPRINTER(cx, &jp->sprinter, &jp->pool, 0); JS_InitArenaPool(&jp->pool, name, 256, 1, &cx->scriptStackQuota); jp->indent = indent; jp->pretty = !!pretty; jp->grouped = !!grouped; jp->strict = !!strict; - jp->error = false; jp->script = NULL; jp->dvgfence = NULL; jp->pcstack = NULL; jp->fun = fun; jp->localNames = NULL; if (fun && fun->isInterpreted() && fun->script()->bindings.hasLocalNames()) { jp->localNames = fun->script()->bindings.getLocalNameArray(cx, &jp->pool); if (!jp->localNames) { js_DestroyPrinter(jp); return NULL; } } return jp; } -JSBool +void js_DestroyPrinter(JSPrinter *jp) { JS_FinishArenaPool(&jp->pool); - bool error = jp->error; jp->sprinter.context->free(jp); - return error; } JSString * js_GetPrinterOutput(JSPrinter *jp) { JSContext *cx; JSString *str; @@ -2328,17 +2324,17 @@ Decompile(SprintStack *ss, jsbytecode *p jp2 = js_NewPrinter(cx, "nested_function", fun, jp->indent, jp->pretty, jp->grouped, jp->strict); if (!jp2) return NULL; ok = js_DecompileFunction(jp2); if (ok && jp2->sprinter.base) js_puts(jp, jp2->sprinter.base); - ok &= !!js_DestroyPrinter(jp2); + js_DestroyPrinter(jp2); if (!ok) return NULL; js_puts(jp, "\n\n"); break; case SRC_BRACE: js_printf(jp, "\t{\n"); jp->indent += 4; @@ -4612,20 +4608,22 @@ Decompile(SprintStack *ss, jsbytecode *p break; case JSOP_USESHARP: i = (jsint) GET_UINT16(pc + UINT16_LEN); todo = Sprint(&ss->sprinter, "#%u#", (unsigned) i); break; #endif /* JS_HAS_SHARP_VARS */ +#if JS_HAS_DEBUGGER_KEYWORD case JSOP_DEBUGGER: js_printf(jp, "\tdebugger;\n"); todo = -2; break; +#endif /* JS_HAS_DEBUGGER_KEYWORD */ #if JS_HAS_XML_SUPPORT case JSOP_STARTXML: case JSOP_STARTXMLEXPR: inXML = op == JSOP_STARTXML; todo = -2; break; @@ -4920,18 +4918,17 @@ js_DecompileToString(JSContext *cx, cons jp = js_NewPrinter(cx, name, fun, indent, pretty, grouped, strict); if (!jp) return NULL; if (decompiler(jp)) str = js_GetPrinterOutput(jp); else str = NULL; - if (!js_DestroyPrinter(jp)) - return NULL; + js_DestroyPrinter(jp); return str; } static const char native_code_str[] = "\t[native code]\n"; JSBool js_DecompileFunctionBody(JSPrinter *jp) { @@ -5304,20 +5301,17 @@ DecompileExpression(JSContext *cx, JSScr false, false, false); if (jp) { jp->dvgfence = end; jp->pcstack = pcstack; if (DecompileCode(jp, script, begin, (uintN) len, (uintN) pcdepth)) { name = (jp->sprinter.base) ? jp->sprinter.base : (char *) ""; name = JS_strdup(cx, name); } - if (!js_DestroyPrinter(jp)) { - cx->free(name); - name = NULL; - } + js_DestroyPrinter(jp); } out: cx->free(pcstack); return name; } uintN
--- a/js/src/jsopcode.h +++ b/js/src/jsopcode.h @@ -306,17 +306,17 @@ js_QuoteString(JSContext *cx, JSString * * functions need not be re-marked with a strict directive. It should * be false in the outermost printer. */ extern JSPrinter * js_NewPrinter(JSContext *cx, const char *name, JSFunction *fun, uintN indent, JSBool pretty, JSBool grouped, JSBool strict); -extern JSBool +extern void js_DestroyPrinter(JSPrinter *jp); extern JSString * js_GetPrinterOutput(JSPrinter *jp); extern int js_printf(JSPrinter *jp, const char *format, ...);
--- a/js/src/jsparse.cpp +++ b/js/src/jsparse.cpp @@ -6198,23 +6198,25 @@ Parser::statement() case TOK_EOL: case TOK_SEMI: pn = UnaryNode::create(tc); if (!pn) return NULL; pn->pn_type = TOK_SEMI; return pn; +#if JS_HAS_DEBUGGER_KEYWORD case TOK_DEBUGGER: pn = NullaryNode::create(tc); if (!pn) return NULL; pn->pn_type = TOK_DEBUGGER; tc->flags |= TCF_FUN_HEAVYWEIGHT; break; +#endif /* JS_HAS_DEBUGGER_KEYWORD */ #if JS_HAS_XML_SUPPORT case TOK_DEFAULT: { pn = UnaryNode::create(tc); if (!pn) return NULL; if (!tokenStream.matchToken(TOK_NAME) ||
--- a/js/src/jsscan.cpp +++ b/js/src/jsscan.cpp @@ -1038,28 +1038,20 @@ TokenStream::getTokenInternal() /* * Check for keywords unless we saw Unicode escape or parser asks * to ignore keywords. */ if (!hadUnicodeEscape && !(flags & TSF_KEYWORD_IS_NAME) && (kw = FindKeyword(tokenbuf.begin(), tokenbuf.length()))) { if (kw->tokentype == TOK_RESERVED) { - if (!ReportCompileErrorNumber(cx, this, NULL, JSREPORT_ERROR, + if (!ReportCompileErrorNumber(cx, this, NULL, JSREPORT_WARNING | JSREPORT_STRICT, JSMSG_RESERVED_ID, kw->chars)) { goto error; } - } else if (kw->tokentype == TOK_STRICT_RESERVED) { - if (isStrictMode() - ? !ReportStrictModeError(cx, this, NULL, NULL, JSMSG_RESERVED_ID, kw->chars) - : !ReportCompileErrorNumber(cx, this, NULL, - JSREPORT_STRICT | JSREPORT_WARNING, - JSMSG_RESERVED_ID, kw->chars)) { - goto error; - } } else if (kw->version <= VersionNumber(version)) { tt = kw->tokentype; tp->t_op = (JSOp) kw->op; goto out; } } atom = atomize(cx, tokenbuf);
--- a/js/src/jsscan.h +++ b/js/src/jsscan.h @@ -139,17 +139,16 @@ enum TokenKind { TOK_SEQ = 82, /* synthetic sequence of statements, not a block */ TOK_FORHEAD = 83, /* head of for(;;)-style loop */ TOK_ARGSBODY = 84, /* formal args in list + body at end */ TOK_UPVARS = 85, /* lexical dependencies as JSAtomList of definitions paired with a parse tree full of uses of those names */ TOK_RESERVED, /* reserved keywords */ - TOK_STRICT_RESERVED, /* reserved keywords in strict mode */ TOK_LIMIT /* domain size */ }; static inline bool TokenKindIsXML(TokenKind tt) { return tt == TOK_AT || tt == TOK_DBLCOLON || tt == TOK_ANYNAME; }
--- a/js/src/jstracer.cpp +++ b/js/src/jstracer.cpp @@ -14973,23 +14973,16 @@ TraceRecorder::record_JSOP_FORLOCAL() } JS_REQUIRES_STACK AbortableRecordingStatus TraceRecorder::record_JSOP_POPN() { return ARECORD_CONTINUE; } -static inline bool -IsFindableCallObj(JSObject *obj) -{ - return obj->isCall() && - (obj->callIsForEval() || obj->getCallObjCalleeFunction()->isHeavyweight()); -} - /* * Generate LIR to reach |obj2| from |obj| by traversing the scope chain. The * generated code also ensures that any call objects found have not changed shape. * * obj starting object * obj_ins LIR instruction representing obj * targetObj end object for traversal * targetIns [out] LIR instruction representing obj2 @@ -15021,20 +15014,23 @@ TraceRecorder::traverseScopeChain(JSObje * and can bypass the scope chain traversal completely. */ bool foundCallObj = false; bool foundBlockObj = false; JSObject* searchObj = obj; for (;;) { if (searchObj != globalObj) { - if (searchObj->isBlock()) + Class* clasp = searchObj->getClass(); + if (clasp == &js_BlockClass) { foundBlockObj = true; - else if (IsFindableCallObj(searchObj)) + } else if (clasp == &js_CallClass && + searchObj->getCallObjCalleeFunction()->isHeavyweight()) { foundCallObj = true; + } } if (searchObj == targetObj) break; searchObj = searchObj->getParent(); if (!searchObj) RETURN_STOP("cannot traverse this scope chain on trace"); @@ -15053,17 +15049,18 @@ TraceRecorder::traverseScopeChain(JSObje for (;;) { if (obj != globalObj) { if (!js_IsCacheableNonGlobalScope(obj)) RETURN_STOP("scope chain lookup crosses non-cacheable object"); // We must guard on the shape of all call objects for heavyweight functions // that we traverse on the scope chain: if the shape changes, a variable with // the same name may have been inserted in the scope chain. - if (IsFindableCallObj(obj)) { + if (obj->isCall() && + obj->getCallObjCalleeFunction()->isHeavyweight()) { if (!exit) exit = snapshot(BRANCH_EXIT); guard(true, w.name(w.eqiN(w.ldiObjShape(obj_ins), obj->shape()), "guard_shape"), exit); } }
--- a/js/src/jsversion.h +++ b/js/src/jsversion.h @@ -84,16 +84,17 @@ #define JS_HAS_OBJ_PROTO_PROP 1 /* has o.__proto__ etc. */ #else #define JS_HAS_OBJ_PROTO_PROP 0 /* has o.__proto__ etc. */ #endif #define JS_HAS_OBJ_WATCHPOINT 0 /* has o.watch and o.unwatch */ #define JS_HAS_SHARP_VARS 0 /* has #n=, #n# for object literals */ #define JS_HAS_XDR 0 /* has XDR API and internal support */ #define JS_HAS_TOSOURCE 0 /* has Object/Array toSource method */ +#define JS_HAS_DEBUGGER_KEYWORD 0 /* has hook for debugger keyword */ #define JS_HAS_CATCH_GUARD 0 /* has exception handling catch guard */ #define JS_HAS_SPARSE_ARRAYS 0 /* array methods preserve empty elems */ #define JS_HAS_UNEVAL 0 /* has uneval() top-level function */ #define JS_HAS_CONST 0 /* has JS2 const as alternative var */ #define JS_HAS_FUN_EXPR_STMT 0 /* has function expression statement */ #define JS_HAS_NO_SUCH_METHOD 0 /* has o.__noSuchMethod__ handler */ #define JS_HAS_XML_SUPPORT 0 /* has ECMAScript for XML support */ #define JS_HAS_ARRAY_EXTRAS 0 /* has indexOf and Lispy extras */ @@ -111,16 +112,17 @@ #define JS_HAS_STR_HTML_HELPERS 1 /* has str.anchor, str.bold, etc. */ #define JS_HAS_PERL_SUBSTR 1 /* has str.substr */ #define JS_HAS_OBJ_PROTO_PROP 1 /* has o.__proto__ etc. */ #define JS_HAS_OBJ_WATCHPOINT 1 /* has o.watch and o.unwatch */ #define JS_HAS_SHARP_VARS 1 /* has #n=, #n# for object literals */ #define JS_HAS_XDR 1 /* has XDR API and internal support */ #define JS_HAS_TOSOURCE 1 /* has Object/Array toSource method */ +#define JS_HAS_DEBUGGER_KEYWORD 1 /* has hook for debugger keyword */ #define JS_HAS_CATCH_GUARD 1 /* has exception handling catch guard */ #define JS_HAS_SPARSE_ARRAYS 0 /* array methods preserve empty elems */ #define JS_HAS_UNEVAL 1 /* has uneval() top-level function */ #define JS_HAS_CONST 1 /* has JS2 const as alternative var */ #define JS_HAS_FUN_EXPR_STMT 1 /* has function expression statement */ #define JS_HAS_NO_SUCH_METHOD 1 /* has o.__noSuchMethod__ handler */ #define JS_HAS_XML_SUPPORT 0 /* has ECMAScript for XML support */ #define JS_HAS_ARRAY_EXTRAS 0 /* has indexOf and Lispy extras */ @@ -134,16 +136,17 @@ #define JS_HAS_STR_HTML_HELPERS 1 /* has str.anchor, str.bold, etc. */ #define JS_HAS_PERL_SUBSTR 1 /* has str.substr */ #define JS_HAS_OBJ_PROTO_PROP 1 /* has o.__proto__ etc. */ #define JS_HAS_OBJ_WATCHPOINT 1 /* has o.watch and o.unwatch */ #define JS_HAS_SHARP_VARS 1 /* has #n=, #n# for object literals */ #define JS_HAS_XDR 1 /* has XDR API and internal support */ #define JS_HAS_TOSOURCE 1 /* has Object/Array toSource method */ +#define JS_HAS_DEBUGGER_KEYWORD 1 /* has hook for debugger keyword */ #define JS_HAS_CATCH_GUARD 1 /* has exception handling catch guard */ #define JS_HAS_SPARSE_ARRAYS 0 /* array methods preserve empty elems */ #define JS_HAS_UNEVAL 1 /* has uneval() top-level function */ #define JS_HAS_CONST 1 /* has JS2 const as alternative var */ #define JS_HAS_FUN_EXPR_STMT 1 /* has function expression statement */ #define JS_HAS_NO_SUCH_METHOD 1 /* has o.__noSuchMethod__ handler */ #define JS_HAS_XML_SUPPORT 1 /* has ECMAScript for XML support */ #define JS_HAS_ARRAY_EXTRAS 1 /* has indexOf and Lispy extras */ @@ -157,16 +160,17 @@ #define JS_HAS_STR_HTML_HELPERS 1 /* has str.anchor, str.bold, etc. */ #define JS_HAS_PERL_SUBSTR 1 /* has str.substr */ #define JS_HAS_OBJ_PROTO_PROP 1 /* has o.__proto__ etc. */ #define JS_HAS_OBJ_WATCHPOINT 1 /* has o.watch and o.unwatch */ #define JS_HAS_SHARP_VARS 1 /* has #n=, #n# for object literals */ #define JS_HAS_XDR 1 /* has XDR API and internal support */ #define JS_HAS_TOSOURCE 1 /* has Object/Array toSource method */ +#define JS_HAS_DEBUGGER_KEYWORD 1 /* has hook for debugger keyword */ #define JS_HAS_CATCH_GUARD 1 /* has exception handling catch guard */ #define JS_HAS_SPARSE_ARRAYS 0 /* array methods preserve empty elems */ #define JS_HAS_UNEVAL 1 /* has uneval() top-level function */ #define JS_HAS_CONST 1 /* has JS2 const as alternative var */ #define JS_HAS_FUN_EXPR_STMT 1 /* has function expression statement */ #define JS_HAS_NO_SUCH_METHOD 1 /* has o.__noSuchMethod__ handler */ #define JS_HAS_XML_SUPPORT 1 /* has ECMAScript for XML support */ #define JS_HAS_ARRAY_EXTRAS 1 /* has indexOf and Lispy extras */ @@ -180,16 +184,17 @@ #define JS_HAS_STR_HTML_HELPERS 1 /* has str.anchor, str.bold, etc. */ #define JS_HAS_PERL_SUBSTR 1 /* has str.substr */ #define JS_HAS_OBJ_PROTO_PROP 1 /* has o.__proto__ etc. */ #define JS_HAS_OBJ_WATCHPOINT 1 /* has o.watch and o.unwatch */ #define JS_HAS_SHARP_VARS 1 /* has #n=, #n# for object literals */ #define JS_HAS_XDR 1 /* has XDR API and internal support */ #define JS_HAS_TOSOURCE 1 /* has Object/Array toSource method */ +#define JS_HAS_DEBUGGER_KEYWORD 1 /* has hook for debugger keyword */ #define JS_HAS_CATCH_GUARD 1 /* has exception handling catch guard */ #define JS_HAS_SPARSE_ARRAYS 0 /* array methods preserve empty elems */ #define JS_HAS_UNEVAL 1 /* has uneval() top-level function */ #define JS_HAS_CONST 1 /* has JS2 const as alternative var */ #define JS_HAS_FUN_EXPR_STMT 1 /* has function expression statement */ #define JS_HAS_NO_SUCH_METHOD 1 /* has o.__noSuchMethod__ handler */ #define JS_HAS_XML_SUPPORT 1 /* has ECMAScript for XML support */ #define JS_HAS_ARRAY_EXTRAS 1 /* has indexOf and Lispy extras */ @@ -200,16 +205,20 @@ #define JS_HAS_EXPR_CLOSURES 1 /* has function (formals) listexpr */ #else #error "unknown JS_VERSION" #endif +/* Features that are present in all versions. */ +#define JS_HAS_RESERVED_JAVA_KEYWORDS 1 +#define JS_HAS_RESERVED_ECMA_KEYWORDS 1 + /* Support for JS_NewGlobalObject. */ #define JS_HAS_NEW_GLOBAL_OBJECT 1 /* Support for JS_MakeSystemObject. */ #define JS_HAS_MAKE_SYSTEM_OBJECT 1 /* Feature-test macro for evolving destructuring support. */ #define JS_HAS_DESTRUCTURING_SHORTHAND (JS_HAS_DESTRUCTURING == 2)
deleted file mode 100644 --- a/js/src/tests/ecma_5/misc/future-reserved-words.js +++ /dev/null @@ -1,122 +0,0 @@ -/* - * Any copyright is dedicated to the Public Domain. - * http://creativecommons.org/licenses/publicdomain/ - */ - -//----------------------------------------------------------------------------- -var BUGNUMBER = 497869; -var summary = "Implement FutureReservedWords per-spec"; - -print(BUGNUMBER + ": " + summary); - -/************** - * BEGIN TEST * - **************/ - -var futureReservedWords = - ["class", - // "const", // Mozilla extension enabled even for versionless code - "enum", - "export", - "extends", - "import", - "super"]; - -var strictFutureReservedWords = - [ - "implements", - "interface", - // "let", // Mozilla extension, strict checks disabled for now - "package", - "private", - "protected", - "public", - "static", - // "yield", // Mozilla extension, strict checks disabled for now - ]; - -function testWord(word, expectNormal, expectStrict) -{ - var actual, status; - - // USE IN VARIABLE DECLARATION - - actual = ""; - status = summary + ", normal var: " + word; - try - { - eval("var " + word + ";"); - actual = "no error"; - } - catch (e) - { - actual = "error"; - status += ", " + e.name + ": " + e.message + " "; - } - reportCompare(expectNormal, actual, status); - - actual = ""; - status = summary + ", strict var: " + word; - try - { - eval("'use strict'; var " + word + ";"); - actual = "no error"; - } - catch (e) - { - actual = "error"; - status += ", " + e.name + ": " + e.message + " "; - } - reportCompare(expectStrict, actual, status); - - - // USE AS LHS FOR ASSIGNMENT - - actual = ""; - status = summary + ", normal assignment: " + word; - try - { - eval(word + " = 'foo';"); - actual = "no error"; - } - catch(e) - { - actual = "error"; - status += ", " + e.name + ": " + e.message + " "; - } - reportCompare(expectNormal, actual, status); - - actual = ""; - status = summary + ", strict assignment: " + word; - try - { - eval("'use strict'; " + word + " = 'foo';"); - actual = "no error"; - } - catch(e) - { - actual = "error"; - status += ", " + e.name + ": " + e.message + " "; - } - reportCompare(expectStrict, actual, status); -} - -function testFutureReservedWord(word) -{ - testWord(word, "error", "error"); -} - -function testStrictFutureReservedWord(word) -{ - testWord(word, "no error", "error"); -} - -futureReservedWords.forEach(testFutureReservedWord); -strictFutureReservedWords.forEach(testStrictFutureReservedWord); - -/******************************************************************************/ - -if (typeof reportCompare === "function") - reportCompare(true, true); - -print("All tests passed!");
--- a/js/src/tests/ecma_5/misc/jstests.list +++ b/js/src/tests/ecma_5/misc/jstests.list @@ -1,9 +1,8 @@ url-prefix ../../jsreftest.html?test=ecma_5/misc/ script global-numeric-properties.js script redeclare-var-non-writable-property.js script enumerate-undefined.js script unwrapped-no-such-method.js script explicit-undefined-optional-argument.js script function-definition-eval.js skip-if(!xulRuntime.shell) script function-definition-evaluate.js # needs evaluate() -script future-reserved-words.js
--- a/js/src/tests/js1_5/Regress/jstests.list +++ b/js/src/tests/js1_5/Regress/jstests.list @@ -55,16 +55,17 @@ script regress-229006.js script regress-230216-1.js script regress-230216-2.js script regress-230216-3.js script regress-233483-2.js script regress-233483.js script regress-234389.js script regress-238881.js script regress-238945.js +script regress-240317.js script regress-240577.js script regress-243174.js script regress-243389-n.js script regress-243869.js script regress-244470.js script regress-244619.js script regress-245113.js script regress-245308.js
new file mode 100644 --- /dev/null +++ b/js/src/tests/js1_5/Regress/regress-240317.js @@ -0,0 +1,68 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* + * Any copyright is dedicated to the Public Domain. + * http://creativecommons.org/licenses/publicdomain/ + * Contributor: Bob Clary + */ + +//----------------------------------------------------------------------------- +var BUGNUMBER = 240317; +var summary = 'Using Reserved identifiers warns'; +var actual = ''; +var expect = 'no error'; + +printBugNumber(BUGNUMBER); +printStatus (summary); + +function testvar(words) +{ + var e; + expect = 'no error'; + for (var i = 0; i < words.length; i++) + { + var word = words[i]; + + actual = ''; + status = summary + ': ' + word; + try + { + eval('var ' + word + ';'); + actual = 'no error'; + } + catch(e) + { + actual = 'error'; + status += ', ' + e.name + ': ' + e.message + ' '; + } + reportCompare(expect, actual, status); + + actual = ''; + status = summary + ': ' + word; + try + { + eval(word + ' = "foo";'); + actual = 'no error'; + } + catch(e) + { + actual = 'error'; + status += ', ' + e.name + ': ' + e.message + ' '; + } + reportCompare(expect, actual, status); + + } +} + +// future reserved words +var reserved = + ['abstract', 'enum', 'int', 'short', 'boolean', + 'interface', 'static', 'byte', 'extends', + 'long', 'super', 'char', 'final', 'native', + 'synchronized', 'class', 'float', 'package', 'throws', + 'goto', 'private', 'transient', + 'implements', 'protected', 'volatile', 'double', + 'public']; + +testvar(reserved); + +
--- a/js/src/tests/js1_5/extensions/regress-355736.js +++ b/js/src/tests/js1_5/extensions/regress-355736.js @@ -47,23 +47,23 @@ test(); //----------------------------------------------------------------------------- function test() { enterFunc ('test'); printBugNumber(BUGNUMBER); printStatus (summary); - f = function() { [implements] = q; }; - expect = 'function() { [implements] = q; }'; + f = function() { [super] = q; }; + expect = 'function() { [super] = q; }'; actual = f + ''; compareSource(expect, actual, summary + ': 1'); - f = function() { return { get implements() { } } }; - expect = 'function() { return { get implements() { } }; }'; + f = function() { return { get super() { } } }; + expect = 'function() { return { get super() { } }; }'; actual = f + ''; compareSource(expect, actual, summary + ': 2'); f = function() { [goto] = a }; expect = 'function() { [goto] = a; }'; actual = f + ''; compareSource(expect, actual, summary + ': 3');
--- a/layout/base/tests/chrome/chrome_content_integration_window.xul +++ b/layout/base/tests/chrome/chrome_content_integration_window.xul @@ -16,18 +16,18 @@ src="data:text/html,<div style='position:absolute;left:0;top:0;width:100%;height:100px;background:yellow;border-bottom:100px solid black'>"/> <!-- the top 100px is a strip of black above the content iframe --> <vbox style="border-top:100px solid black;"/> </stack> <script type="application/javascript"> <![CDATA[ var imports = [ "SimpleTest", "is", "isnot", "ok" ]; - for each (var name in imports) { - window[name] = window.opener.wrappedJSObject[name]; + for each (var import in imports) { + window[import] = window.opener.wrappedJSObject[import]; } function runTests() { var testCanvas = snapshotWindow(window); var refCanvas = snapshotWindow(window); var ctx = refCanvas.getContext('2d'); ctx.fillStyle = "black";
--- a/layout/base/tests/chrome/chrome_over_plugin_window.xul +++ b/layout/base/tests/chrome/chrome_over_plugin_window.xul @@ -17,18 +17,18 @@ <vbox style="height:25px; background:rgba(0,128,0,0.5);"/> <!-- plugin should be covered here --> <vbox style="height:50px;"/> <!-- plugin should be visible here --> </vbox> </stack> <script type="application/javascript"> <![CDATA[ var imports = [ "SimpleTest", "is", "isnot", "ok", "todo" ]; - for each (var name in imports) { - window[name] = window.opener.wrappedJSObject[name]; + for each (var import in imports) { + window[import] = window.opener.wrappedJSObject[import]; } var plugin; function waitForPaint() { if (plugin.getPaintCount() < 1) { setTimeout(waitForPaint, 0); return; }
--- a/layout/base/tests/chrome/default_background_window.xul +++ b/layout/base/tests/chrome/default_background_window.xul @@ -13,18 +13,18 @@ <iframe type="content" id="f" src="about:blank" style="border:1px solid black;"/> <script type="application/javascript"> <![CDATA[ SimpleTest.waitForExplicitFinish(); var imports = [ "SimpleTest", "is", "isnot", "ok" ]; - for each (var name in imports) { - window[name] = window.opener.wrappedJSObject[name]; + for each (var import in imports) { + window[import] = window.opener.wrappedJSObject[import]; } function snapshot(win) { var el = document.createElementNS("http://www.w3.org/1999/xhtml", "canvas"); el.width = win.innerWidth; el.height = win.innerHeight; var ctx = el.getContext("2d");
--- a/layout/reftests/editor/xul/platform.js +++ b/layout/reftests/editor/xul/platform.js @@ -4,25 +4,25 @@ // platform. var id; var ua = navigator.userAgent; if (/Windows/.test(ua)) { id = "win"; if (/NT 5\.1/.test(ua) || /NT 5\.2; Win64/.test(ua)) - var classname = "winxp"; + var class = "winxp"; } else if (/Linux/.test(ua)) id = "linux"; else if (/SunOS/.test(ua)) id = "linux"; else if (/Mac OS X/.test(ua)) id = "mac"; if (id) document.documentElement.setAttribute("id", id); else document.documentElement.appendChild( document.createTextNode("Unrecognized platform") ); -if (classname) - document.documentElement.setAttribute("class", classname); +if (class) + document.documentElement.setAttribute("class", class);
--- a/layout/style/test/chrome/hover_helper.html +++ b/layout/style/test/chrome/hover_helper.html @@ -31,18 +31,18 @@ <div style="width: 5000px; height: 10px;"></div> </div> </div> <pre id="test"> <script type="application/javascript"> var imports = [ "SimpleTest", "is", "isnot", "ok" ]; -for each (var name in imports) { - window[name] = window.opener.wrappedJSObject[name]; +for each (var import in imports) { + window[import] = window.opener.wrappedJSObject[import]; } var div = document.getElementById("display"); var divtwo = document.getElementById("two"); var iframe = document.getElementById("twoi"); var divtwoparent = document.getElementById("twoparent"); iframe.contentDocument.open();
--- a/testing/mochitest/browser-harness.xul +++ b/testing/mochitest/browser-harness.xul @@ -199,18 +199,18 @@ get htmlLog() { let txtToHTML = Cc["@mozilla.org/txttohtmlconv;1"]. getService(Ci.mozITXTToHTMLConv); function _entityEncode(str) { return txtToHTML.scanTXT(str, Ci.mozITXTToHTMLConv.kEntities); } var path = _entityEncode(this.path); var html = this.results.map(function (t) { - var classname = t.info ? "info" : "result " + (t.pass ? "passed" : "failed"); - return "<p class=\"" + classname + "\">" + t.result + " | " + path + + var class = t.info ? "info" : "result " + (t.pass ? "passed" : "failed"); + return "<p class=\"" + class + "\">" + t.result + " | " + path + " | " + _entityEncode(t.msg) + "</p>"; }).join("\n"); if (this.duration) { html += "<p class=\"info\">TEST-END | " + path + " | finished in " + this.duration + " ms</p>"; } return html; }
--- a/toolkit/components/ctypes/tests/unit/test_jsctypes.js.in +++ b/toolkit/components/ctypes/tests/unit/test_jsctypes.js.in @@ -77,22 +77,22 @@ function do_check_throws(f, type, stack) do_check_true(true); return; } do_throw("expected " + type.name + " exception, caught " + exc, stack); } do_throw("expected " + type.name + " exception, none thrown", stack); } -function do_check_class(obj, classname, stack) +function do_check_class(obj, class, stack) { if (!stack) stack = Components.stack.caller; - do_check_eq(Object.prototype.toString.call(obj), "[object " + classname + "]", stack); + do_check_eq(Object.prototype.toString.call(obj), "[object " + class + "]", stack); } function run_test() { // Test ctypes.CType and ctypes.CData are set up correctly. run_abstract_class_tests(); // open the library
--- a/toolkit/content/tests/chrome/bug263683_window.xul +++ b/toolkit/content/tests/chrome/bug263683_window.xul @@ -50,18 +50,18 @@ const Ci = Components.interfaces; const Cc = Components.classes; const Cr = Components.results; var gFindBar = null; var gBrowser; var imports = ["SimpleTest", "ok"]; - for each (var name in imports) { - window[name] = window.opener.wrappedJSObject[name]; + for each (var import in imports) { + window[import] = window.opener.wrappedJSObject[import]; } function finish() { window.close(); SimpleTest.finish(); } function startTest() {
--- a/toolkit/content/tests/chrome/bug331215_window.xul +++ b/toolkit/content/tests/chrome/bug331215_window.xul @@ -50,18 +50,18 @@ const Ci = Components.interfaces; const Cc = Components.classes; const Cr = Components.results; var gFindBar = null; var gBrowser; var imports = ["SimpleTest", "ok"]; - for each (var name in imports) { - window[name] = window.opener.wrappedJSObject[name]; + for each (var import in imports) { + window[import] = window.opener.wrappedJSObject[import]; } function finish() { window.close(); SimpleTest.finish(); } function startTest() {
--- a/toolkit/content/tests/chrome/bug451286_window.xul +++ b/toolkit/content/tests/chrome/bug451286_window.xul @@ -52,18 +52,18 @@ const Cr = Components.results; const SEARCH_TEXT = "text"; const DATAURI = "data:text/html," + SEARCH_TEXT; var gFindBar = null; var gBrowser; var imports = ["SimpleTest", "ok", "snapshotWindow", "compareSnapshots"]; - for each (var name in imports) { - window[name] = window.opener.wrappedJSObject[name]; + for each (var import in imports) { + window[import] = window.opener.wrappedJSObject[import]; } function finish() { window.close(); SimpleTest.finish(); } function startTest() {
--- a/toolkit/content/tests/chrome/bug451540_window.xul +++ b/toolkit/content/tests/chrome/bug451540_window.xul @@ -57,18 +57,18 @@ var sendCtrl = true; var sendMeta = false; if (navigator.platform.indexOf("Mac") >= 0) { sendCtrl = false; sendMeta = true; } var imports = [ "SimpleTest", "ok"]; - for each (var name in imports) { - window[name] = window.opener.wrappedJSObject[name]; + for each (var import in imports) { + window[import] = window.opener.wrappedJSObject[import]; } function finishTest() { window.close(); SimpleTest.finish(); }