Skip to content

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

Closed
@sandersn

Description

@sandersn

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptInfrastructureIssue relates to TypeScript team infrastructure

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions