2014-07-22 01:09:02 +02:00
|
|
|
// Copyright (c) 2012 Ecma International. All rights reserved.
|
2015-07-17 17:42:45 +02:00
|
|
|
// This code is governed by the BSD license found in the LICENSE file.
|
2014-07-22 01:09:02 +02:00
|
|
|
|
|
|
|
/*---
|
2014-07-25 00:41:42 +02:00
|
|
|
es5id: 12.10-7-1
|
2014-07-22 01:09:02 +02:00
|
|
|
description: with introduces scope - restores the earlier environment on exit
|
2015-03-23 17:34:52 +01:00
|
|
|
flags: [noStrict]
|
2014-07-22 01:09:02 +02:00
|
|
|
---*/
|
|
|
|
|
|
|
|
var a = 1;
|
|
|
|
|
|
|
|
var o = {a : 2};
|
2015-08-13 17:33:42 +02:00
|
|
|
try {
|
2014-07-22 01:09:02 +02:00
|
|
|
with (o) {
|
|
|
|
a = 3;
|
|
|
|
throw 1;
|
|
|
|
a = 4;
|
|
|
|
}
|
2015-08-13 17:33:42 +02:00
|
|
|
} catch (e) {
|
|
|
|
// intentionally ignored
|
2014-07-22 01:09:02 +02:00
|
|
|
}
|
|
|
|
|
2015-08-13 17:33:42 +02:00
|
|
|
assert.sameValue(a, 1, 'a');
|
|
|
|
assert.sameValue(o.a, 3, 'o.a');
|