See bug 807862 - Use strict mode for all builtin JS

Note that some of those warnings are from SpiderMonkey's non-standard "extra warnings" mode, not ES5 strict mode. To confuse matters, "extra warnings" were called "strict warnings" before ES5 and are controlled by the "javascript.options.strict" pref.

SpiderMonkey already forces ES5 strict mode and "extra warnings" mode for all self-hosted JS: bug 784295.

chris


On 10/2/14 12:22 PM, Jeff Gilbert wrote:
We should most likely assert when we have strict violations in chrome JS.
We should *definitely* assert when we have JS errors in chrome JS.
I don't see how there should be any excuse for either of these cases.

We certainly can't assert on non-browser JS errors, but we should keep our own 
scripts clean.

----- Original Message -----
From: "chiaki ISHIKAWA" <ishik...@yk.rim.or.jp>
To: dev-platform@lists.mozilla.org
Sent: Thursday, October 2, 2014 11:59:04 AM
Subject: JavaScript (strict) Warning from FF mochitest-plain test.

Hi,

I was looking at a large number of JavaScript (strict) warnings, and
errors from the recording of |make mozmill| test run of locall-built
DEBUG BUILD of TB last several days after a refresh of C-C source tree.

The number of such has increased very much both
  - due to the seemingly stricter checks done by JS infrastructure, and
  - new carelessly written code,
I think.

But the sheer number of them overwhelmed me and I began wondering is FF
faring better?

I don't think so.

Here are the list of such errors summarized from the
log of |./mach mochitest-plain| of locally-built DEBUG BUILD of FF (from
M-C portion of C-C source tree).

The # at the beginning of each line is the frequency of the occurrences.
[I was looking at "getter only" message which is printed for more than
3K times during |make mozmill| test for TB for "Services" when checking
the health of logs from FF tests came to my mind.)

I think we need a sort of "sheriff" to look at
these warnings and file bugzilla entries accordingly from time to time:
I say this because it seems not many people look at debug build run of
test suite often (well, at least on TB side. I don't know if TB debug
run is created regularly.)

Excerpt from summary of the log : ./mach mochitest-plain

  ========================================
  JavaScript strict warning
  jquery.js and jquery-ui.js are ignored.
  ========================================

     206 JavaScript error:
file:///home/ishikawa/ff-objdir-tb3/dist/bin/components/nsHandlerService.js,
line 891: NS_ERROR_FAILURE: Component returned failure code: 0x80004005
(NS_ERROR_FAILURE) [nsIProperties.get]
      99 JavaScript strict warning: , line 0: TypeError: setting
getter-only property "PrivateBrowsingUtils"
      66 JavaScript strict warning: , line 0: TypeError: setting
getter-only property "Services"
      33 JavaScript strict warning: , line 0: TypeError: setting
getter-only property "TelemetryStopwatch"
      33 JavaScript strict warning: , line 0: TypeError: setting
getter-only property "Task"
      33 JavaScript strict warning: , line 0: TypeError: setting
getter-only property "PlacesUtils"
      33 JavaScript strict warning: , line 0: TypeError: setting
getter-only property "NewTabUtils"
      11 JavaScript strict warning:
chrome://specialpowers/content/specialpowersAPI.js, line 214:
ReferenceError: reference to undefined property
x.SpecialPowers_wrappedObject
       4 JavaScript error: resource://gre/modules/XPCOMUtils.jsm, line
110: SyntaxError: missing ; before statement
       4 JavaScript error:
http://example.com/tests/content/base/test/bug696301-script-1.js, line
3: ReferenceError: c is not defined
       4 JavaScript error: , line 0: uncaught exception: 2147500033
       3 JavaScript strict warning:
resource://specialpowers/MockFilePicker.jsm, line 92: SyntaxError: octal
literals and octal escape sequences are deprecated
       3 JavaScript strict warning:
chrome://specialpowers/content/specialpowersAPI.js, line 662:
ReferenceError: reference to undefined property wrapPrivileged(...).classes
       3 JavaScript error: , line 0: uncaught exception: Permission
denied to add http://mochi.test:8888/%sas a protocol handler
       2 JavaScript strict warning:
chrome://specialpowers/content/specialpowersAPI.js, line 665:
ReferenceError: reference to undefined property wrapPrivileged(...).results
       2 JavaScript error: resource://gre/modules/vtt.jsm, line 1261:
TypeError: self.window.VTTRegion is not a constructor
       2 JavaScript error: , line 0: uncaught exception: Permission
denied to add http://remotehost:8888/%s as a content or protocol handler
       2 JavaScript error: , line 0: uncaught exception: Permission
denied to add ftp://mochi.test:8888/%s as a content or protocol handler
       2 JavaScript error: , line 0: uncaught exception: Permission
denied to add foo://mochi.test:8888/%s as a content or protocol handler
       2 JavaScript error: , line 0: uncaught exception: 2152923148
       1 JavaScript warning: resource://gre/modules/Preferences.jsm, line
381: mutating the [[Prototype]] of an object will cause your code to run
very slowly; instead create the object with the correct initial
[[Prototype]] value using Object.create
       1 JavaScript strict warning: resource://gre/modules/Webapps.jsm,
line 539: ReferenceError: reference to undefined property
Components.classes['@mozilla.org/app-migrator;1']
       1 JavaScript strict warning: resource://gre/modules/Webapps.jsm,
line 389: ReferenceError: reference to undefined property aManifest.type
       1 JavaScript strict warning: resource://gre/modules/Webapps.jsm,
line 361: ReferenceError: reference to undefined property aResult.redirects
       1 JavaScript strict warning: resource://gre/modules/Webapps.jsm,
line 2136: ReferenceError: reference to undefined property app.appStatus
       1 JavaScript strict warning: resource://gre/modules/Webapps.jsm,
line 1683: ReferenceError: reference to undefined property aApp.appStatus
       1 JavaScript strict warning: resource://gre/modules/Webapps.jsm,
line 1087: ReferenceError: reference to undefined property msg.app
       1 JavaScript strict warning:
resource://gre/modules/FormHistory.jsm, line 639: ReferenceError:
reference to undefined property change.guid
       1 JavaScript strict warning:
resource://gre/modules/DownloadUtils.jsm, line 79: SyntaxError: applying
the 'delete' operator to an unqualified name is deprecated
       1 JavaScript strict warning:
resource://gre/modules/BrowserElementPromptService.jsm, line 617:
ReferenceError: reference to undefined property
this._browserElementChildMap[this._getOuterWindowID(...)]
       1 JavaScript strict warning: resource://gre/modules/AppsUtils.jsm,
line 757: ReferenceError: reference to undefined property
this._manifest[aProp]
       1 JavaScript strict warning:
resource:///modules/PluginContent.jsm, line 718: ReferenceError:
reference to undefined property this.content
       1 JavaScript strict warning:
resource:///modules/BrowserUITelemetry.jsm, line 196: ReferenceError:
reference to undefined property input.id
       1 JavaScript strict warning:
file:///home/ishikawa/ff-objdir-tb3/dist/bin/components/nsSearchService.js,
line 3193: ReferenceError: reference to undefined property cache.directories
       1 JavaScript strict warning:
file:///home/ishikawa/ff-objdir-tb3/dist/bin/components/nsPrompter.js,
line 213: ReferenceError: assignment to undeclared variable port
    ... [ omission ] ...

These references to undefined whatever seem to have appeared suddenly
thanks to
the stricter checking of JS infrastructure.
Obviously, some intended actions of the code were NOP.
I wonder what the program was doing with incorrect references before
(!?) Obviously, some intended actions of the code were NOP or incorrect.
Hmm...

TIA
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform


_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to