Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

"use strict" behaviour change in 46

49 views
Skip to first unread message

assaf dagan

unread,
Mar 27, 2016, 3:53:16 PM3/27/16
to
Hi,

Please forgive me if I am posting this question in the wrong forum. it's the closest one that I have found that relates with my issue.

While testing my company extension with FF46 I started observing new TypeError exception:
TypeError: can't assign to properties of (new Boolean(false)): not an object

the code which produced it is basically doing something similar to this:
(function() {
"use strict";
var a = false;
a.b=false;
})();

While this code is clearly wrong, and the exception makes sense, it did not throw any exception prior to FF46, and just ignored the wrong assignment as it would without using strict mode.
In our codebase, I I found this behaviour on jquery.qtip.js which is pretty popular.

I could not find a reference in FF46 release notes indicating that change in behavior.
I wonder whether this should be better documented just to save time for others who run into similar issue.

Regards,
Assaf

Boris Zbarsky

unread,
Mar 28, 2016, 11:01:19 AM3/28/16
to kohei....@gmail.com
On 3/27/16 3:53 PM, assaf dagan wrote:
> While testing my company extension with FF46 I started observing new TypeError exception:
> TypeError: can't assign to properties of (new Boolean(false)): not an object
>
> the code which produced it is basically doing something similar to this:
> (function() {
> "use strict";
> var a = false;
> a.b=false;
> })();

Looks like this changed as a result of
https://bugzilla.mozilla.org/show_bug.cgi?id=603201 getting fixed. We
should probably get this added to
<https://www.fxsitecompat.com/versions/46/> at least; I filed
<https://github.com/fxsitecompat/www.fxsitecompat.com/issues/11>.

Also filed <https://bugzilla.mozilla.org/show_bug.cgi?id=1260131> for
the fact that the exception message does not in fact make any sense.

-Boris

Boris Zbarsky

unread,
Mar 28, 2016, 11:04:03 AM3/28/16
to
On 3/27/16 3:53 PM, assaf dagan wrote:
> While testing my company extension with FF46

Oh, and thank you for doing that!

> In our codebase, I I found this behaviour on jquery.qtip.js which is pretty popular.

Hmm. I wonder how that works in other browsers (I mean the jQuery
library bit, not your extension). I did check that the pattern you
posted throws in Chrome and Safari as well, so it's possible the library
got updated, or doesn't get run in strict mode much....

-Boris

assaf...@capriza.com

unread,
Mar 28, 2016, 2:51:58 PM3/28/16
to
qtip code is running in "strict mode" not the extension.
I had some time to debug this further and found out it really our code which pass complex JSON option configuration to qtip, and in some cases pass false instead of an object. somewhere inside that option object. indeed we use old version of it and it might be sanitized better in newer versions.
Thanks for filling the relevant tickets on it. Indeed the error message was strange and hard to understand.

>
> -Boris

Assaf

Jason Orendorff

unread,
Mar 28, 2016, 3:41:38 PM3/28/16
to Boris Zbarsky, kohei....@gmail.com, dev-tech-...@lists.mozilla.org
On Mon, Mar 28, 2016 at 10:01 AM, Boris Zbarsky <bzba...@mit.edu> wrote:

> On 3/27/16 3:53 PM, assaf dagan wrote:
>
>> While testing my company extension with FF46 I started observing new
>> TypeError exception:
>> TypeError: can't assign to properties of (new Boolean(false)): not an
>> object
>>
> [...] Also filed <https://bugzilla.mozilla.org/show_bug.cgi?id=1260131>
> for the fact that the exception message does not in fact make any sense.
>

Thanks, Boris.

-j
0 new messages