Closed fizker closed 8 years ago
That matches the spec. The error message summarizes it well.
The problem is that our webapp breaks in es6-shim because it tries to test whether or not to shim the feature
@fizker this is indeed part of the spec - you'll need to use typeof Object.getOwnPropertyDescriptor(RegExp.prototype, 'flags').get !== 'function'
to detect it.
@ljharb No, technically you need to use that :P. I have made a PR with it
ha, touché. i haven't yet updated things to pass in Chrome Canary. Thanks for the PR.
Fixed in c563abf238df6d08f293cb54903fd4df54d5a885
Perfect :). Do you know when this will get released? I would prefer to get it into production as soon as possible, as the crash was rather nasty.
I will release it shortly, but it's Chrome Canary - nobody using a canary build should have any expectation of any site working. Chrome Stable won't release with it for many weeks.
Still, I would prefer having more time for testing, as we are not on the newest es6-shim. If I am not mistaken, we are still on a version that uses String#contains
rather than String#includes
, so a lot of other things could also be breaking changes. Anyway, thanks for the quick turn-around on this issue :)
aha, that's a very very old version indeed - you will want to upgrade soon. I'll have v0.33.11 out today.
Nice! Thanks :)
One of the shims adds a getter for
RegExp.prototype.flags
, and guards against overriding the native by reading the current value.But reading
RegExp.prototype.flags
throws an error in Chrome Canary (48.0.2559.0):Uncaught TypeError: RegExp.prototype.global getter called on non-RegExp object
.Note: Chrome Canary requires the
Experimental JavaScript
flag to be enabled before exposingRegExp.prototype.flags
.