Skip to content
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

Tests using __proto__ without appropriate features entry #3998

Open
linusg opened this issue Jan 29, 2024 · 1 comment
Open

Tests using __proto__ without appropriate features entry #3998

linusg opened this issue Jan 29, 2024 · 1 comment

Comments

@linusg
Copy link
Member

linusg commented Jan 29, 2024

Found some randomly (there may be more, only did a quick search):

assert.sameValue(mysteryTA.buffer.__proto__, ArrayBuffer.prototype);

i8a.__proto__ = { 2: 'wrong value' };

assert.sameValue(ta_ab.__proto__, ta_rab.__proto__);

Unless __proto__ is actually relevant to the test, Object.get/setPrototypeOf() should be preferred IMO. __proto__ is "Normative Optional, Legacy", so new engines may not want to implement it (which is how I ended up here to begin with :^)).

For reference:

__proto__

@ljharb
Copy link
Member

ljharb commented Jan 29, 2024

Instead of using Object.getPrototypeOf, there should probably be a test helper that uses both, since there are engines that have dunder proto but not getPrototypeOf.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants