mirror of
https://github.com/tc39/test262.git
synced 2025-09-24 02:28:05 +02:00
Enable strict mode testing for sm/Promise
This commit is contained in:
parent
addfc1f0f0
commit
1b58c83e0a
@ -2,15 +2,13 @@
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
flags:
|
||||
- noStrict
|
||||
description: |
|
||||
pending
|
||||
esid: pending
|
||||
---*/
|
||||
|
||||
var promise = Promise.resolve(1);
|
||||
var FakeCtor = function(exec){ exec(function(){}, function(){}); };
|
||||
Object.defineProperty(Promise, Symbol.species, {value: FakeCtor});
|
||||
// This just shouldn't crash. It does without bug 1287334 fixed.
|
||||
promise.then(function(){});
|
||||
|
||||
|
@ -2,16 +2,14 @@
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
flags:
|
||||
- noStrict
|
||||
description: |
|
||||
pending
|
||||
esid: pending
|
||||
---*/
|
||||
|
||||
// This just shouldn't trigger a failed assert.
|
||||
// It does without bug 1288382 fixed.
|
||||
Promise.all.call(class {
|
||||
constructor(exec){ exec(()=>{}, ()=>{}); }
|
||||
static resolve() { return {then(){}}; }
|
||||
}, [null]);
|
||||
|
||||
|
@ -2,16 +2,14 @@
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
flags:
|
||||
- noStrict
|
||||
description: |
|
||||
pending
|
||||
esid: pending
|
||||
---*/
|
||||
|
||||
var global = $262.createRealm().global;
|
||||
Promise.prototype.then = global.Promise.prototype.then;
|
||||
p1 = new Promise(function f(r) {
|
||||
var p1 = new Promise(function f(r) {
|
||||
r(1);
|
||||
});
|
||||
p2 = p1.then(function g(){});
|
||||
|
||||
var p2 = p1.then(function g(){});
|
||||
|
@ -2,12 +2,10 @@
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
flags:
|
||||
- noStrict
|
||||
description: |
|
||||
pending
|
||||
esid: pending
|
||||
---*/
|
||||
|
||||
assert.sameValue(Object.keys(Promise).length, 0);
|
||||
assert.sameValue(Object.keys(Promise.prototype).length, 0);
|
||||
|
||||
|
@ -2,16 +2,14 @@
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
flags:
|
||||
- noStrict
|
||||
description: |
|
||||
pending
|
||||
esid: pending
|
||||
---*/
|
||||
|
||||
assert.sameValue(Promise[Symbol.species], Promise);
|
||||
let prop = Object.getOwnPropertyDescriptor(Promise, Symbol.species);
|
||||
assert.sameValue('get' in prop, true);
|
||||
assert.sameValue(typeof prop.get, 'function');
|
||||
assert.sameValue('set' in prop, true);
|
||||
assert.sameValue(prop.set, undefined);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user