question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

An issue about redefining TypeError

See original GitHub issue
Version

chakra-9e2f198

Test case
TypeError.prototype.toString = function() {
    return Error;
};
var a = 1;
a();
Execution steps
./ChakraCore/out/Release/ch testcase.js
Output

Expected behavior
TypeError: a is not a function
Description

In the above test case, we redefine TypeError, but there is an exception in the redefined function (line 2). When executing the code, since a is not a function, TypeError will be thrown in line 5. Other engines seem to ignore the exception when redefining TypeError (line 2) when executing, and throw a TypeError exception normally, but chakra didn’t . This seems to be incorrect.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:12

github_iconTop GitHub Comments

1reaction
rhuanjlcommented, Jan 7, 2021

So my conclusion is chakracore functions correctly on this but ch’s behaviour is unhelpful We could update ch to output something here which may make testing some fringe issues easier.

0reactions
YiWen-ycommented, Jan 27, 2021

I understand. Thanks for your reply.

Read more comments on GitHub >

github_iconTop Results From Across the Web

TypeError: can't redefine non-configurable property "x"
The JavaScript exception "can't redefine non-configurable property" occurs when it was attempted to redefine a property, but that property is non-configurable.
Read more >
TypeError: Cannot redefine property: default #1974 - GitHub
I fixed it by keeping the package-lock in the repo. It's probably caused by conflicting dependencies. All reactions.
Read more >
javascript - Street View error - Stack Overflow
We were facing the very same error string, but seen when loading just the embedded map itself. It appeared that we were redefining...
Read more >
Ask Question - Salesforce Stack Exchange
Uncaught TypeError: Cannot redefine property: title throws at .../aura_prod.js (Lightning Locker) · Ask Question. Asked 6 years, 5 months ago.
Read more >
Can't redefine non-configurable property "x" - GeeksforGeeks
JavaScript TypeError – Can't redefine non-configurable property “x” ... This JavaScript exception can't redefine non-configurable property occurs ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found