1
// Copyright 2009 the Sputnik authors. All rights reserved.
2
// This code is governed by the BSD license found in the LICENSE file.
5
* The with statement adds a computed object to the front of the
6
* scope chain of the current execution context
8
* @path ch12/12.10/S12.10_A1.7_T4.js
9
* @description Calling a function within "with" statement declared within the statement, leading to completion by exception
16
var result = "result";
21
valueOf : function(){return 'obj_valueOf';},
22
parseInt : function(){return 'obj_parseInt';},
24
Infinity : 'obj_Infinity',
25
eval : function(){return 'obj_eval';},
26
parseFloat : function(){return 'obj_parseFloat';},
27
isNaN : function(){return 'obj_isNaN';},
28
isFinite : function(){return 'obj_isFinite';}
34
var st_parseInt = "parseInt";
36
var st_Infinity = "Infinity";
38
var st_parseFloat = "parseFloat";
39
var st_isNaN = "isNaN";
40
var st_isFinite = "isFinite";
48
st_parseInt = parseInt;
50
st_Infinity = Infinity;
52
st_parseFloat = parseFloat;
54
st_isFinite = isFinite;
69
if(!(result === "value")){
70
$ERROR('#0: result === "value". Actual: result ==='+ result );
74
$ERROR('#1: p1 === 1. Actual: p1 ==='+ p1 );
78
$ERROR('#2: p2 === "x2". Actual: p2 ==='+ p2 );
82
$ERROR('#3: p3 === 3. Actual: p3 ==='+ p3 );
87
$ERROR('#4: p4 is not defined');
92
$ERROR('#5: p5 === "x5". Actual: p5 ==='+ p5 );
95
if(!(myObj.p1 === "x1")){
96
$ERROR('#6: myObj.p1 === "x1". Actual: myObj.p1 ==='+ myObj.p1 );
99
if(!(myObj.p2 === "b")){
100
$ERROR('#7: myObj.p2 === "b". Actual: myObj.p2 ==='+ myObj.p2 );
103
if(!(myObj.p3 === undefined)){
104
$ERROR('#8: myObj.p3 === undefined. Actual: myObj.p3 ==='+ myObj.p3 );
107
if(!(myObj.p4 === undefined)){
108
$ERROR('#9: myObj.p4 === undefined. Actual: myObj.p4 ==='+ myObj.p4 );
111
if(!(myObj.p5 === undefined)){
112
$ERROR('#10: myObj.p5 === undefined. Actual: myObj.p5 ==='+ myObj.p5 );
115
if(!(st_parseInt !== parseInt)){
116
$ERROR('#11: myObj.parseInt !== parseInt');
119
if(!(st_NaN === "obj_NaN")){
120
$ERROR('#12: myObj.NaN !== NaN');
123
if(!(st_Infinity !== Infinity)){
124
$ERROR('#13: myObj.Infinity !== Infinity');
127
if(!(st_eval !== eval)){
128
$ERROR('#14: myObj.eval !== eval');
131
if(!(st_parseFloat !== parseFloat)){
132
$ERROR('#15: myObj.parseFloat !== parseFloat');
135
if(!(st_isNaN !== isNaN)){
136
$ERROR('#16: myObj.isNaN !== isNaN');
139
if(!(st_isFinite !== isFinite)){
140
$ERROR('#17: myObj.isFinite !== isFinite');
145
$ERROR('#18: value is not defined');
150
if(!(myObj.value === "myObj_value")){
151
$ERROR('#19: myObj.value === "myObj_value". Actual: myObj.value ==='+ myObj.value );