-
Notifications
You must be signed in to change notification settings - Fork 105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Illegal Invocation from createClock #170
Comments
Not good. Thanks for reporting! Which version worked? Any reproducible code? Hard to dig into without a test case. |
It looks like both 2.4.0 and 2.4.1 are broken, but 2.3.2 works. It seems to happen as soon as a test calls |
This also looks like the issue I addressed here: https://github.com/sinonjs/lolex/pull/162/files I also ran into this when trying to run the lolex tests in headless chrome. |
This started happening to me yesterday as well. I get |
Versions 2.4.0 and 2.4.1 also don't work on Firefox. You can see it in build result: https://travis-ci.org/sinonjs/lolex/jobs/376426623#L2348 |
Fixed by #162. Released as 2.4.2. |
I'm worrying I may have done something wrong as other people say it is fixed, but it still doesn't work for me. I ran a minimal code on console to reproduce the issue to make sure my NPM installation does not affect the result: navigator.userAgent
// Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.87 Safari/537.36
const value = Object.create(performance);
Object.getOwnPropertyNames(window.Performance.prototype)
// (17) ["timeOrigin", "onresourcetimingbufferfull", "timing", "navigation", "memory", "now", "getEntries", "getEntriesByType", "getEntriesByName", "clearResourceTimings", "setResourceTimingBufferSize", "mark", "clearMarks", "measure", "clearMeasures", "toJSON", "constructor"]
Object.getOwnPropertyDescriptor(Performance.prototype, 'mark').writable
// true
value.mark = Performance.prototype.mark;
Object.defineProperty(window, 'performance', { writable: false, value });
performance.mark('foo');
// VM130:1 Uncaught TypeError: 'Illegal invocation' Can anyone confirm this, or point out a mistake? |
Confirmed, this is still broken on my build as of Sinon release 6.1.5, which is running lolex 2.7.1. |
Just to clarify my confirmation as well, this is occurring in Chrome and Headless Chrome. |
Just updated lolex and started getting a bunch of test failures with this error:
Tests are being run in Chrome 68 headless.
The text was updated successfully, but these errors were encountered: