mirror of
https://github.com/tc39/test262.git
synced 2025-07-31 01:44:54 +02:00
The "mainline" tests in Test262 are converging on a more formal structure. Files are organized as tests for either either "language" (e.g. syntax-driven) or "built-in" (e.g. API-driven). "Language" test locations are themselves structured according to whether the syntactic form under test is an Expression or a Statement. To limit ambiguity when locating/adding tests, re-organize the tests for Annex B extensions to match this structure.
22 lines
528 B
JavaScript
22 lines
528 B
JavaScript
// Copyright (c) 2012 Ecma International. All rights reserved.
|
|
// This code is governed by the BSD license found in the LICENSE file.
|
|
|
|
/*---
|
|
es5id: 12.14-2
|
|
es6id: B.3.5
|
|
description: >
|
|
catch doesn't change declaration scope - var initializer in catch
|
|
with same name as catch parameter changes parameter
|
|
---*/
|
|
|
|
function capturedFoo() {return foo};
|
|
foo = "prior to throw";
|
|
try {
|
|
throw new Error();
|
|
}
|
|
catch (foo) {
|
|
var foo = "initializer in catch";
|
|
}
|
|
|
|
assert.sameValue(capturedFoo(), "prior to throw");
|