1// Copyright JS Foundation and other contributors, http://js.foundation 2// 3// Licensed under the Apache License, Version 2.0 (the "License"); 4// you may not use this file except in compliance with the License. 5// You may obtain a copy of the License at 6// 7// http://www.apache.org/licenses/LICENSE-2.0 8// 9// Unless required by applicable law or agreed to in writing, software 10// distributed under the License is distributed on an "AS IS" BASIS 11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12// See the License for the specific language governing permissions and 13// limitations under the License. 14 15function f1(x) 16{ 17 var c1 = (x >= 1); 18 var c2 = (x <= 10); 19 20 if (c1 === true) 21 { 22 if (c2 === true) 23 { 24 assert(t); 25 26 return; 27 } 28 } 29 30 assert(t === false); 31} 32 33var i; 34var t = true; 35 36for(i = 1; i <= 10; i++) 37{ 38 f1(i); 39} 40 41t = false; 42 43for(i = 11; i <= 20; i++) 44{ 45 f1(i); 46} 47 48function g (p, p) { 49 assert (p === arguments[1]); 50 assert (p === 'second'); 51} 52 53g ('first', 'second'); 54 55try { 56 f1 ({}); 57 f1 (undefined_variable); 58 assert (false); 59} 60catch (e) { 61 assert (e instanceof ReferenceError); 62} 63 64function f2 () 65{ 66 return this; 67} 68 69with ({}) 70{ 71 assert (f2 () === this); 72} 73