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 15var c = 4; 16var z = 5; 17 18function addX(x) { 19 return function(n) { 20 var b = 2; 21 return n + x; 22 } 23} 24 25addThree = addX(3); 26d = addThree(c+z); 27 28function f() { 29 try { 30 throw "error"; 31 } 32 catch (err) { 33 var c = 10; 34 } 35 36 var m = null; 37 38 var user = { 39 name: "John", 40 age: 30 41 }; 42 43 var x = true; 44 var b = 10; 45 46 (function() { 47 var a = [1,2,3] 48 a.y = "abc"; 49 with (a) { 50 var h = [4,5,6] 51 with (h) { 52 h.d = "dfg" 53 } 54 a.d = x; 55 } 56 })(); 57} 58 59f(); 60 61