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.

Incorrect results for [[Get]] and [[HasProperty]] with Typed Array in prototype

See original GitHub issue

There was previously an inconsistency between [[Get]]/[[Set]] and [[HasProperty]] as noted in https://github.com/tc39/ecma262/issues/347. However, we did not comply with the old semantics either (our [[HasProperty]] seemed to be guarded on the receiver as well). The new semantics remove all the receiver checks.

var o = {__proto__: new Int32Array(100)};
Object.prototype[1.3] = 100;
print(o[1.3]);
print(Reflect.has(o, '1.3'));

Expected: undefined/false (same as v8) Actual: 100/true (same as sm)

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:13 (13 by maintainers)

github_iconTop GitHub Comments

1reaction
dilijevcommented, Jun 13, 2016

@bterlson @ianwjhalliday - ignore previous comment. A closer look showed that we were mistaken (cc @curtisman @Yongqu).

Fix in progress.

0reactions
bterlsoncommented, Jul 21, 2016

The original bug’s expected behavior is indeed what is expected.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Incorrect results for [[Get]] and [[HasProperty]] with Typed Array in ...
Investigating and trying to understand the issue and solution. I hope to have this completed today. All reactions.
Read more >
How to define method in javascript on Array.prototype and ...
defineProperty(Array.prototype, "find", { enumerable: false, writable: true, ... It's because have to check for hasOwnProperty :
Read more >
Object.prototype.hasOwnProperty() - JavaScript | MDN
The hasOwnProperty() method returns a boolean indicating whether the ... that has a property with this name may return incorrect results:.
Read more >
The 10 Most Common JavaScript Issues Developers Face
JavaScript Issue #1: Incorrect References to this. There's no shortage of confusion among ... Executing the above code results in the following error:...
Read more >
Lodash Documentation
The values false , null , 0 , "" , undefined , and NaN are falsey. ... Gets the index at which the...
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