Fix tests issues

This commit is contained in:
Leo Balter 2021-09-14 08:12:34 -07:00 committed by Rick Waldron
parent 6a5b818896
commit 227977a8e6
2 changed files with 5 additions and 3 deletions

View File

@ -19,7 +19,7 @@ const s = r.evaluate('Symbol("foobar")');
assert.sameValue(typeof s, 'symbol');
assert.sameValue(s.constructor, Symbol, 'primitive does not expose other ShadowRealm constructor');
assert.sameValue(Object.getPrototypeOf(s), Symbol.prototype);
assert.sameValue(Symbol.prototype.toString.call(s), 'Symbol()');
assert.sameValue(Symbol.prototype.toString.call(s), 'Symbol(foobar)');
const shadowX = r.evaluate('Symbol.for("my symbol name")');
const myX = Symbol.for('my symbol name')
@ -42,8 +42,10 @@ assert.sameValue(
'Symbol.keyFor cannot find a key for a regular symbol created in the shadow realm'
);
const { get: description } = Object.getOwnPropertyDescriptor(Symbol.prototype, 'description');
assert.sameValue(
Symbol.prototype.description.call(s),
description.call(s),
'foobar',
'get description for the symbol created in the shadow realm'
);

View File

@ -12,7 +12,7 @@ const realm2 = new ShadowRealm();
globalThis.count = 0;
asserts.notSameValue(realm1, realm2);
assert.notSameValue(realm1, realm2);
const r1wrapped = realm1.evaluate(`
globalThis.count = 0;