diff --git a/test/language/statements/try/cptn-catch-empty-break.js b/test/language/statements/try/cptn-catch-empty-break.js new file mode 100644 index 0000000000000000000000000000000000000000..d862d3971354ef98b47314542b397d0c050a6753 --- /dev/null +++ b/test/language/statements/try/cptn-catch-empty-break.js @@ -0,0 +1,18 @@ +// Copyright (C) 2017 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-try-statement-runtime-semantics-evaluation +description: Abrupt completion from catch block calls UpdatEmpty() +info: | + 13.15.8 Runtime Semantics: Evaluation + TryStatement : try Block Catch + ... + 2. If B.[[Type]] is throw, let C be CatchClauseEvaluation of Catch with parameter B.[[Value]]. + ... + 4. Return Completion(UpdateEmpty(C, undefined)). +---*/ + +// Ensure the completion value from the first iteration ('bad completion') is not returned. +var completion = eval("for (var i = 0; i < 2; ++i) { if (i) { try { throw null; } catch (e) { break; } } 'bad completion'; }"); +assert.sameValue(completion, undefined); diff --git a/test/language/statements/try/cptn-catch-empty-continue.js b/test/language/statements/try/cptn-catch-empty-continue.js new file mode 100644 index 0000000000000000000000000000000000000000..d358695257daf41d0d32d9ac55e03be905f4477c --- /dev/null +++ b/test/language/statements/try/cptn-catch-empty-continue.js @@ -0,0 +1,18 @@ +// Copyright (C) 2017 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-try-statement-runtime-semantics-evaluation +description: Abrupt completion from catch block calls UpdatEmpty() +info: | + 13.15.8 Runtime Semantics: Evaluation + TryStatement : try Block Catch + ... + 2. If B.[[Type]] is throw, let C be CatchClauseEvaluation of Catch with parameter B.[[Value]]. + ... + 4. Return Completion(UpdateEmpty(C, undefined)). +---*/ + +// Ensure the completion value from the first iteration ('bad completion') is not returned. +var completion = eval("for (var i = 0; i < 2; ++i) { if (i) { try { throw null; } catch (e) { continue; } } 'bad completion'; }"); +assert.sameValue(completion, undefined); diff --git a/test/language/statements/try/cptn-catch-finally-empty-break.js b/test/language/statements/try/cptn-catch-finally-empty-break.js new file mode 100644 index 0000000000000000000000000000000000000000..b34ba2e93456f1de18423447dc61e4f7f6b5e8cb --- /dev/null +++ b/test/language/statements/try/cptn-catch-finally-empty-break.js @@ -0,0 +1,18 @@ +// Copyright (C) 2017 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-try-statement-runtime-semantics-evaluation +description: Abrupt completion from finally block calls UpdatEmpty() +info: | + 13.15.8 Runtime Semantics: Evaluation + TryStatement : try Block Catch Finally + ... + 4. Let F be the result of evaluating Finally. + ... + 6. Return Completion(UpdateEmpty(F, undefined)). +---*/ + +// Ensure the completion value from the first iteration ('bad completion') is not returned. +var completion = eval("for (var i = 0; i < 2; ++i) { if (i) { try { throw null; } catch (e) {} finally { break; } } 'bad completion'; }"); +assert.sameValue(completion, undefined); diff --git a/test/language/statements/try/cptn-catch-finally-empty-continue.js b/test/language/statements/try/cptn-catch-finally-empty-continue.js new file mode 100644 index 0000000000000000000000000000000000000000..da6641b98238c0f5f5e0dd870ed826b5bf500ca9 --- /dev/null +++ b/test/language/statements/try/cptn-catch-finally-empty-continue.js @@ -0,0 +1,18 @@ +// Copyright (C) 2017 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-try-statement-runtime-semantics-evaluation +description: Abrupt completion from finally block calls UpdatEmpty() +info: | + 13.15.8 Runtime Semantics: Evaluation + TryStatement : try Block Catch Finally + ... + 4. Let F be the result of evaluating Finally. + ... + 6. Return Completion(UpdateEmpty(F, undefined)). +---*/ + +// Ensure the completion value from the first iteration ('bad completion') is not returned. +var completion = eval("for (var i = 0; i < 2; ++i) { if (i) { try { throw null; } catch (e) {} finally { continue; } } 'bad completion'; }"); +assert.sameValue(completion, undefined); diff --git a/test/language/statements/try/cptn-finally-empty-break.js b/test/language/statements/try/cptn-finally-empty-break.js new file mode 100644 index 0000000000000000000000000000000000000000..c32de4ef033662f248ab4380bb5d5374d532e99c --- /dev/null +++ b/test/language/statements/try/cptn-finally-empty-break.js @@ -0,0 +1,18 @@ +// Copyright (C) 2017 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-try-statement-runtime-semantics-evaluation +description: Abrupt completion from finally block calls UpdatEmpty() +info: | + 13.15.8 Runtime Semantics: Evaluation + TryStatement : try Block Finally + ... + 2. Let F be the result of evaluating Finally. + ... + 4. Return Completion(UpdateEmpty(F, undefined)). +---*/ + +// Ensure the completion value from the first iteration ('bad completion') is not returned. +var completion = eval("for (var i = 0; i < 2; ++i) { if (i) { try {} finally { break; } } 'bad completion'; }"); +assert.sameValue(completion, undefined); diff --git a/test/language/statements/try/cptn-finally-empty-continue.js b/test/language/statements/try/cptn-finally-empty-continue.js new file mode 100644 index 0000000000000000000000000000000000000000..c11f33833d11979c1a888cf469153599c3e7a527 --- /dev/null +++ b/test/language/statements/try/cptn-finally-empty-continue.js @@ -0,0 +1,18 @@ +// Copyright (C) 2017 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-try-statement-runtime-semantics-evaluation +description: Abrupt completion from finally block calls UpdatEmpty() +info: | + 13.15.8 Runtime Semantics: Evaluation + TryStatement : try Block Finally + ... + 2. Let F be the result of evaluating Finally. + ... + 4. Return Completion(UpdateEmpty(F, undefined)). +---*/ + +// Ensure the completion value from the first iteration ('bad completion') is not returned. +var completion = eval("for (var i = 0; i < 2; ++i) { if (i) { try {} finally { continue; } } 'bad completion'; }"); +assert.sameValue(completion, undefined);