mirror of
https://github.com/tc39/test262.git
synced 2025-09-26 03:28:50 +02:00
Remove test for non-standard Error stack
This commit is contained in:
parent
193801b9d4
commit
ef7ad927ed
@ -11,50 +11,28 @@ description: |
|
|||||||
esid: pending
|
esid: pending
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
var stack;
|
|
||||||
|
|
||||||
function reset()
|
|
||||||
{
|
|
||||||
stack = "";
|
|
||||||
}
|
|
||||||
|
|
||||||
function assertStackContains(needle, msg)
|
|
||||||
{
|
|
||||||
assert.sameValue(stack.indexOf(needle) >= 0, true,
|
|
||||||
`stack should contain '${needle}': ${msg}`);
|
|
||||||
}
|
|
||||||
|
|
||||||
Object.defineProperty(this, "detectSourceURL", {
|
Object.defineProperty(this, "detectSourceURL", {
|
||||||
get() {
|
get() {
|
||||||
stack = new Error().stack;
|
|
||||||
return 17;
|
return 17;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// block followed by semicolon
|
// block followed by semicolon
|
||||||
reset();
|
|
||||||
assert.sameValue(eval(`x=>{};
|
assert.sameValue(eval(`x=>{};
|
||||||
//# sourceURL=http://example.com/foo.js
|
//# sourceURL=http://example.com/foo.js
|
||||||
detectSourceURL`), 17);
|
detectSourceURL`), 17);
|
||||||
assertStackContains("http://example.com/foo.js", "block, semi");
|
|
||||||
|
|
||||||
// block not followed by semicolon
|
// block not followed by semicolon
|
||||||
reset();
|
|
||||||
assert.sameValue(eval(`x=>{}
|
assert.sameValue(eval(`x=>{}
|
||||||
//# sourceURL=http://example.com/bar.js
|
//# sourceURL=http://example.com/bar.js
|
||||||
detectSourceURL`), 17);
|
detectSourceURL`), 17);
|
||||||
assertStackContains("http://example.com/bar.js", "block, not semi");
|
|
||||||
|
|
||||||
// expr followed by semicolon
|
// expr followed by semicolon
|
||||||
reset();
|
|
||||||
assert.sameValue(eval(`x=>y;
|
assert.sameValue(eval(`x=>y;
|
||||||
//# sourceURL=http://example.com/baz.js
|
//# sourceURL=http://example.com/baz.js
|
||||||
detectSourceURL`), 17);
|
detectSourceURL`), 17);
|
||||||
assertStackContains("http://example.com/baz.js", "expr, semi");
|
|
||||||
|
|
||||||
// expr not followed by semicolon
|
// expr not followed by semicolon
|
||||||
reset();
|
|
||||||
assert.sameValue(eval(`x=>y
|
assert.sameValue(eval(`x=>y
|
||||||
//# sourceURL=http://example.com/quux.js
|
//# sourceURL=http://example.com/quux.js
|
||||||
detectSourceURL`), 17);
|
detectSourceURL`), 17);
|
||||||
assertStackContains("http://example.com/quux.js", "expr, not semi");
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user