-
Notifications
You must be signed in to change notification settings - Fork 4
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
Object.defineProperty nodejs bug as test262 test #6
Comments
That does not make it out of scope. There's a trick to write a test262 test that would seem to depend on a platform API. Probe to detect if the API is present. If not, the test succeeds. There is one precedent -- I wrote a test demonstrating a way that some browser failed to conform. To write the test I had to probe for the existence of "document". If there was none, that test succeeded. I think the test itself is now long retired. But the precedent it set remains! But yes, it is better to avoid the need to do that when we can. |
@erights yes, this relates to what we discovered in September. To avoid breaking jsdom the largest consumer of the |
What's the ETA for v8 5.7 landing in Node? |
@bmeck Do you recommend an interim alternative? I presume none exists. |
@erights Node@9 stable release (April) so Node@10 LTS release (October) @kriskowal none exist but it is a minimal C++ addon to write if you are willing to manage a membrane yourself. |
We definitely cannot wait that long. Neither would it be sensible for us to write C++, and thereby run on something other than stock Node. Instead, we need to figure out how SES, Frozen Realms, and Dan's test262 test can successfully use what Node has in the meantime. For SES and Frozen Realms, I think we can just copy everything we would need from the real global onto the pseudo-global. We should then shadow the real global completely, even for those global variable names whitelisted in whitelist.js |
@erights to be clear the "global" in the |
Yes. Since the result is that Node is presently non-spec-compliant in this regard, we should be able to write a test262 test that visibly fails. Dan is asking for advice on how to do so. |
the script in vmbug2.js doesn't appear to always use the fake global: // test case starts on line 47
var script = '(' + function () {
'use strict';
$.global.x = 10;
Object.defineProperty($.global, 'x', {
writable: false,
enumerable: false,
configurable: false,
value: 20
});
try {
// shouldn't this be $.global.x = 30?
x = 30;
} catch (e) {
print(e);
}
// shouldn't this be print($.global.x)
print(x); // should be 20
print(Object.getOwnPropertyDescriptor($.global, 'x'));
} + ')()'; |
In this respect, vmbug2 just mimics vmbug, which does exhibit the buggy behavior. I presume a purpose of the test is to demonstrate an interaction with the usual way of assigning to globals, i.e. without any qualification. |
I see a comment from kriskowal on Dec 12, 2017 about the node situation:
so I'm taking this off my todo list, or at least demoting it: test excess authority via prototype chain (WIP) |
I gather SES on node is somewhat blocked by...
I'm trying to turn this nodejs bug into a test262 test. I gather this might have some impact on its priority.
At first I thought it was out of scope of ECMA 262 because it depends on node's vm API. But then I noticed an API in test262 that reifies the abstract CreateRealm function as
$.createRealm
.So I'm trying to supply
$.createRealm
to the test instead ofvm.createContext
, but it's not working: when I runnode vmbug.js
, I get 30 etc. as Kris reports in #5679, but when I runnode vmbug2.js
I get 20 with a different exception:Any clues what I'm doing wrong?
cc @erights @kriskowal @metaweta @jfparadis
The text was updated successfully, but these errors were encountered: