simple1.js (1347B)
1 function main() { 2 // A comment so we can test that breakpoint sliding works across 3 // multiple lines 4 const func = foo(1, 2); 5 const result = func(); 6 return result; 7 } 8 9 function doEval() { 10 eval( 11 "(" + 12 function() { 13 debugger; 14 15 window.evaledFunc = function() { 16 var foo = 1; 17 var bar = 2; 18 return foo + bar; 19 }; 20 }.toString() + 21 ")()" 22 ); 23 } 24 25 function doNamedEval() { 26 eval( 27 "(" + 28 function() { 29 debugger; 30 31 window.evaledFunc = function() { 32 var foo = 1; 33 var bar = 2; 34 return foo + bar; 35 }; 36 }.toString() + 37 ")();\n //# sourceURL=evaled.js" 38 ); 39 } 40 41 class MyClass { 42 constructor(a, b, ...rest) { 43 this.#a = a; 44 this.#b = b; 45 } 46 47 #a; 48 #b; 49 50 test( ...args) {} 51 #privateFunc(a, b) { } 52 } 53 54 class Klass { 55 constructor() { 56 this.id = Math.random(); 57 } 58 test() { } 59 bar = function () { } 60 boo = (a, ...b) => {} 61 } 62 63 const o = 1 + 2; 64 console.log(o); 65 66 function normalFunction(foo, ...bar) { } 67 let letFunction = function (a) { }; 68 const constFunction = (x) => {}; 69 70 function ProtoClass(a) {}; 71 ProtoClass.prototype = { 72 protoFoo(foo, ...bar) { }, 73 protoBar: function (x, y) { }, 74 protoBoo: (x) => { }, 75 1234: () => { }, 76 }; 77 78 const bla = {} 79 bla.memFoo = function(a, b) { } 80 bla.arrFoo = (c) => { }