Coverage: try/catch/finally completion values. Fixes gh-1742

This commit is contained in:
Rick Waldron 2020-09-17 14:24:24 -04:00
parent 81db9994c9
commit 5de16292fd
1 changed files with 40 additions and 0 deletions

View File

@ -0,0 +1,40 @@
// Copyright (C) 2020 Rick Waldron. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
description: >
Direct eval try/catch/finally for completion value
esid: sec-performeval
---*/
assert.sameValue(
eval('99; do { -99; try { 42 } catch (e) { -1 } finally { -2; break; -3 }; } while (false);'),
42
);
assert.sameValue(
eval('99; do { -99; try { [].x.x } catch (e) { 42; } finally { -2; break; -3 }; } while (false);'),
42
);
assert.sameValue(
eval('99; do { -99; try { 42 } catch (e) { -1 } finally { -2; break; -3 }; -77 } while (false);'),
42
);
assert.sameValue(
eval('99; do { -99; try { [].x.x } catch (e) { 42; } finally { -2; break; -3 }; -77 } while (false);'),
42
);
assert.sameValue(
eval('99; do { -99; try { 42 } catch (e) { -1 } finally { -2; continue; -3 }; } while (false);'),
42
);
assert.sameValue(
eval('99; do { -99; try { [].x.x } catch (e) { 42; } finally { -2; continue; -3 }; } while (false);'),
42
);
assert.sameValue(
eval('99; do { -99; try { 42 } catch (e) { -1 } finally { -2; continue; -3 }; -77 } while (false);'),
42
);
assert.sameValue(
eval('99; do { -99; try { [].x.x } catch (e) { 42; } finally { -2; continue; -3 }; -77 } while (false);'),
42
);