svnlabs / google-caja

Automatically exported from code.google.com/p/google-caja
0 stars 1 forks source link

SES calls "new WeakMap(true)" which is incorrect ES6 and no longer works on Canary #1932

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
If "new WeakMap" is called with an argument, ES6 demands that the argument be 
iterable. Chrome Canary now enforces that. However, SES's 
ejectorsGuardsTrademarks.js calls "new WeakMap(true)" in two places, in 
accordance with an early and long dead proposal for WeakMaps (also implemented 
at one time by our shim) that the argument be an optional flag that, if set to 
true, would be a hint that the weak association should be optimized to use key 
lifetime rather than map lifetime.

The attached screenshot shows what currently happens loading the SES 
initialization test on Chrome Canary.

Original issue reported on code.google.com by erights@google.com on 15 Aug 2014 at 3:09

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by erights on 15 Aug 2014 at 8:13

GoogleCodeExporter commented 9 years ago
We're still getting this error on Chrome 38 using 5692m.

SES initialization ses-single-frame.opt.js?debug=1:46
 Repaired: Non-deletable RegExp statics are a global communication channel ses-single-frame.opt.js?debug=1:43
 Repaired: Date.prototype is a global communication channel ses-single-frame.opt.js?debug=1:43
 Not repaired: [[ThrowTypeError]] has normal function properties ses-single-frame.opt.js?debug=1:43
 Max Severity: Safe spec violation(1). ses-single-frame.opt.js?debug=1:43
 hookupSESPlus failed with:  TypeError: true is not iterable {stack: (...), message: "true is not iterable"} ses-single-frame.opt.js?debug=1:43
 TypeError: true is not iterable
  at WeakMap (native weak_collection.js:11:3)
  at ejectorsGuardsTrademarks (http://ssl.gstatic.com/caja/5692m/ses-single-frame.opt.js?debug=1:576:238)
  at startSESPrelude (http://ssl.gstatic.com/caja/5692m/ses-single-frame.opt.js?debug=1:547:590)
  at ses.startSES (http://ssl.gstatic.com/caja/5692m/ses-single-frame.opt.js?debug=1:547:725)
  at hookupSESPlusModule (http://ssl.gstatic.com/caja/5692m/ses-single-frame.opt.js?debug=1:585:76)
  at ? (http://ssl.gstatic.com/caja/5692m/ses-single-frame.opt.js?debug=1:585:329) ses-single-frame.opt.js?debug=1:43

Original comment by ma...@google.com on 29 Aug 2014 at 9:34

GoogleCodeExporter commented 9 years ago
Yes, that is very mysterious -- it should have been fixed as of r5691.
Following the link in your stacktrace to 
http://ssl.gstatic.com/caja/5692m/ses-single-frame.opt.js?debug=1:576:238
I find four mentions of "WeakMap(true)", which indicates a deeper problem, as 
there should not be any of these remaining in this version of Caja.

Reopening and unassigning from myself, as I'm the wrong person for this 
configuration corruption. Kevin? Felix?

Original comment by erights@google.com on 29 Aug 2014 at 9:47

GoogleCodeExporter commented 9 years ago
It hasn't been merged to the es53 branch, which is the one hosted at that URL.

I'll do a standard backport merge.

Original comment by kpreid@google.com on 29 Aug 2014 at 9:53

GoogleCodeExporter commented 9 years ago
Merged @r5693

Original comment by kpreid@google.com on 29 Aug 2014 at 11:09

GoogleCodeExporter commented 9 years ago
Any ETA for availability on gstatic.com?

Original comment by ma...@google.com on 29 Aug 2014 at 11:29

GoogleCodeExporter commented 9 years ago
That should be discussed internally, I would think.

Original comment by kpreid@google.com on 29 Aug 2014 at 11:34