Testcafe-hammerhead: A class that extends `Function` is not getting the correct prototype when running under Hammerhead

Created on 11 Sep 2020  路  2Comments  路  Source: DevExpress/testcafe-hammerhead

What is the Current behavior?

A class that extends Function is not getting the correct prototype.

To reproduce, create a minimal app that executes the following:

class Test extends Function {
    extend() {}
}
console.log(new Test().__proto__);

Running it in Chrome shows the following in dev tools:

image

When running under Testcafe, the following is shown:
image

In Testcafe, instantiated classes that extend Function no longer have access to their methods. Presumably this is due to the native Function being overwritten but I didn't do much other digging once I could create a test case.

Your Environment details:

  • node.js version: v14.4.0
  • browser name and version: Chrome Version 85.0.4183.102 (Official Build) (64-bit)
  • platform and version: Observed on OSX and Windows
client level 2 client side processing bug

Most helpful comment

The code is in the rest-hooks library. https://codesandbox.io/s/vigorous-taussig-cpt73?file=/src/App.js has a small rest-hooks app that should exhibit the behavior.

All 2 comments

@praxxis

Hello,

Thank you for your research. I reproduced the issue. Our team will examine this behavior and check for a suitable solution.

but I didn't do much other digging once I could create a test case

Could you please share a real-world example with us? It will help us research the issue in a real scenario.

The code is in the rest-hooks library. https://codesandbox.io/s/vigorous-taussig-cpt73?file=/src/App.js has a small rest-hooks app that should exhibit the behavior.

Was this page helpful?
0 / 5 - 0 ratings