2011-09-07 08:35:18 +02:00
|
|
|
// Copyright 2009 the Sputnik authors. All rights reserved.
|
|
|
|
// This code is governed by the BSD license found in the LICENSE file.
|
|
|
|
|
2014-07-22 01:09:02 +02:00
|
|
|
/*---
|
|
|
|
info: ToObject conversion from null value must throw TypeError
|
2014-11-28 23:28:42 +01:00
|
|
|
es5id: 12.10-2-5
|
2014-07-22 01:09:02 +02:00
|
|
|
description: Trying to convert null to Object
|
|
|
|
flags: [noStrict]
|
|
|
|
---*/
|
2011-09-07 08:35:18 +02:00
|
|
|
|
|
|
|
try{
|
|
|
|
with(null) x = 2;
|
2021-07-22 21:58:54 +02:00
|
|
|
throw new Test262Error('#2.1: with(null) x = 2 must throw TypeError. Actual: x === . Actual: ' + (x));
|
2011-09-14 07:37:44 +02:00
|
|
|
}
|
2011-09-07 08:35:18 +02:00
|
|
|
catch(e){
|
|
|
|
if((e instanceof TypeError) !== true){
|
2021-07-22 21:58:54 +02:00
|
|
|
throw new Test262Error('#2.2: with(null) x = 2 must throw TypeError. Actual: ' + (e));
|
2011-09-07 08:35:18 +02:00
|
|
|
}
|
|
|
|
}
|