test: add known_issues test for #10223#11024
Conversation
|
cc/ @fhinkel , @bnoordhuis |
There was a problem hiding this comment.
This will be flagged by the linter. It additionally flags that util on line 7 is never used.
There was a problem hiding this comment.
Could you use single quotes around "foo" on this line and the next please.
94d0b34 to
eb884de
Compare
There was a problem hiding this comment.
I'd return the descriptor and then check that .writable, .enumerable and .configurable are all false.
There was a problem hiding this comment.
suggestion incorporated:)
There was a problem hiding this comment.
ah, I just added the check for 'writable'. As a way to compare it all at once, would that work?:
const code = `
Object.defineProperty(this, 'foo', {value: 5});
Object.getOwnPropertyDescriptor(this, 'foo');
`;
const desc = vm.runInContext(code, context);
const foo = {value: 5, writable: false, configurable: false, enumerable: true}
assert.strictEqual(desc, foo)
There was a problem hiding this comment.
If you use assert.deepStrictEqual(), it should.
There was a problem hiding this comment.
I tried, but I don't think assert.deepStrictEqual() is working as intended...
I tested on a positive example and it throws an error:
const desc = vm.runInContext(code, context);
//desc: { value: 5, writable: true, enumerable: true, configurable: true }
const foo = {value: 5, writable: true, configurable: true, enumerable: true};
assert.deepStrictEqual(desc, foo); // throw new assert.AssertionError
eb884de to
7d07e8e
Compare
|
Thanks! Landed in e8bb9e6. |
PR-URL: #11024 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
PR-URL: #11024 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
PR-URL: #11024 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
PR-URL: #11024 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
PR-URL: #11024 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
PR-URL: #11024 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passesAffected core subsystem(s)
tests
Description of change
Test addressing #10223 is added to the known_issues directory.
Writable attribute should be false by default.
In v6+ (reverted
524f693) it is set to true irrespective of whetherit was set to false or left out in Object.defineProperty call.
It will be fixed with the 5.5 V8 API changes