Skip to content

Performance framework makes fourslash tests fail in runtests-browser #9954

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

Closed
sandersn opened this issue Jul 26, 2016 · 2 comments
Closed

Performance framework makes fourslash tests fail in runtests-browser #9954

sandersn opened this issue Jul 26, 2016 · 2 comments
Labels
Bug A bug in TypeScript Infrastructure Issue relates to TypeScript team infrastructure

Comments

@sandersn
Copy link
Member

Run:

gulp runtests-browser --t='fourslash/commentsClassMembers.ts' --browser=chrome

Expected: the test passes

Actual: "TypeError: Illegal invocation at getCompletionData (bundle.js:54363)"

This line is a call to timestamp in performance.ts

In performance.ts, changing this line from

    export const timestamp = typeof performance !== "undefined" && performance.now ? performance.now : Date.now ? Date.now : () => +(new Date());
     export const timestamp = () => Date.now();

fixes the bug. Searching indicates that this error happens when you try to call an function without providing the expected this, like performance.now or Date.now. Node and Chrome are OK with ripping off Date.now, so I suspect it's performance.now.

@sandersn
Copy link
Member Author

@weswigham can you take a look and see if this is from a change your or @rbuckton made?

@RyanCavanaugh RyanCavanaugh added Bug A bug in TypeScript Infrastructure Issue relates to TypeScript team infrastructure labels Jul 26, 2016
@sandersn
Copy link
Member Author

Actually, this change succeeds too:

    export const timestamp = typeof performance !== "undefined" && performance.now ? () => performance.now() : Date.now ? Date.now : () => +(new Date());

That seems like an actual fix. I'll send out a PR.

@microsoft microsoft locked and limited conversation to collaborators Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug A bug in TypeScript Infrastructure Issue relates to TypeScript team infrastructure
Projects
None yet
Development

No branches or pull requests

2 participants