"use strict" behaviour change in 46

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

"use strict" behaviour change in 46

assaf dagan
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

_______________________________________________
dev-tech-js-engine mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-js-engine
Reply | Threaded
Open this post in threaded view
|

Re: "use strict" behaviour change in 46

Boris Zbarsky
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
_______________________________________________
dev-tech-js-engine mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-js-engine
Reply | Threaded
Open this post in threaded view
|

Re: "use strict" behaviour change in 46

Boris Zbarsky
In reply to this post by assaf dagan
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
_______________________________________________
dev-tech-js-engine mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-js-engine
Reply | Threaded
Open this post in threaded view
|

Re: "use strict" behaviour change in 46

assaf.dagan
In reply to this post by Boris Zbarsky
On Monday, 28 March 2016 18:04:03 UTC+3, Boris Zbarsky  wrote:

> 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....
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
_______________________________________________
dev-tech-js-engine mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-js-engine
Reply | Threaded
Open this post in threaded view
|

Re: "use strict" behaviour change in 46

Jason Orendorff-2
In reply to this post by Boris Zbarsky
On Mon, Mar 28, 2016 at 10:01 AM, Boris Zbarsky <[hidden email]> 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
_______________________________________________
dev-tech-js-engine mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-js-engine