Summary: | REGRESSION(r131106): magnitude-perf.js calls bind on undefined | ||||||
---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Ryosuke Niwa <rniwa> | ||||
Component: | Tools / Tests | Assignee: | Ryosuke Niwa <rniwa> | ||||
Status: | RESOLVED FIXED | ||||||
Severity: | Normal | CC: | abarth, ojan, simonjam, tony, tonyg, webkit.review.bot | ||||
Priority: | P2 | ||||||
Version: | 528+ (Nightly build) | ||||||
Hardware: | Unspecified | ||||||
OS: | Unspecified | ||||||
Attachments: |
|
Description
Ryosuke Niwa
2012-11-20 16:12:27 PST
Created attachment 175298 [details]
Fixes the regression
Comment on attachment 175298 [details]
Fixes the regression
I don't see why we need to call bind at all. Why can't this just be:
var nowFunction = window.performance.now || Date.now;
The original patch that added the bind call doesn't explain this.
(In reply to comment #2) > (From update of attachment 175298 [details]) > I don't see why we need to call bind at all. Why can't this just be: > var nowFunction = window.performance.now || Date.now; > > The original patch that added the bind call doesn't explain this. You get a TypeError: Illegal invocation without it. You can test it in the console. Try storing now in a variable and then invoke that variable. I don't fully understand why. I think this answer might explain it: http://stackoverflow.com/questions/1007340/javascript-function-aliasing-doesnt-seem-to-work It seems wrong to me that you can alias Date.now but not window.performance.now. (In reply to comment #4) > It seems wrong to me that you can alias Date.now but not window.performance.now. performance.now() _does_ vary depending on which window you call it on. It measures the time since that window object started navigating. oic. Sad. I wonder if we can make aliasing of these things work. Probably not. :( Comment on attachment 175298 [details] Fixes the regression Clearing flags on attachment: 175298 Committed r135335: <http://trac.webkit.org/changeset/135335> All reviewed patches have been landed. Closing bug. |