Advertisement
Guest User

Untitled

a guest
Apr 23rd, 2016
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 20.58 KB | None | 0 0
  1. var functionOne = function() {
  2. // Some code
  3. };
  4.  
  5. function functionTwo() {
  6. // Some code
  7. }
  8.  
  9. <script>
  10. // Error
  11. functionOne();
  12.  
  13. var functionOne = function() {
  14. };
  15. </script>
  16.  
  17. <script>
  18. // No error
  19. functionTwo();
  20.  
  21. function functionTwo() {
  22. }
  23. </script>
  24.  
  25. <script>
  26. if (test) {
  27. // Error or misbehavior
  28. function functionThree() { doSomething(); }
  29. }
  30. </script>
  31.  
  32. function xyz(){
  33. function abc(){};
  34. // abc is defined here...
  35. }
  36. // ...but not here
  37.  
  38. var xyz = function abc(){};
  39.  
  40. var xyz = function abc(){
  41. // xyz is visible here
  42. // abc is visible here
  43. }
  44. // xyz is visible here
  45. // abc is undefined here
  46.  
  47. function abc(){};
  48. var xyz = abc;
  49.  
  50. console.log(xyz === abc); // prints "true"
  51.  
  52. function abc(){};
  53. console.log(abc.name); // prints "abc"
  54.  
  55. var abc = function(){};
  56. console.log(abc.name); // prints ""
  57.  
  58. // Assume really.long.external.scoped is {}
  59. really.long.external.scoped.name = function shortcut(n){
  60. // Let it call itself recursively:
  61. shortcut(n - 1);
  62. // ...
  63. // Let is pass itself as a callback:
  64. someFunction(shortcut);
  65. // ...
  66. }
  67.  
  68. function abc(){}
  69.  
  70. // We can call it here
  71. abc(); // Works
  72.  
  73. // Yet, it is defined down there.
  74. function abc(){}
  75.  
  76. // We can call it again
  77. abc(); // Works
  78.  
  79. // We can call it here
  80. abc(); // Works
  81. return;
  82. function abc(){}
  83.  
  84. var xyz = function(){};
  85.  
  86. // We can't call it here
  87. xyz(); // UNDEFINED!!!
  88.  
  89. // Now it is defined
  90. xyz = function(){}
  91.  
  92. // We can call it here
  93. xyz(); // works
  94.  
  95. var xyz = function abc(){};
  96. console.log(xyz.name); // Prints "abc"
  97.  
  98. var abc = function(){};
  99.  
  100. abc = function(){};
  101.  
  102. function abc(){};
  103.  
  104. function x() {
  105. console.log('x');
  106. }
  107.  
  108. x(); // Works even though it's above the declaration
  109. function x() {
  110. console.log('x');
  111. }
  112.  
  113. if (someCondition) {
  114. function foo() { // <===== INVALID AND WILL FAIL ON
  115. } // MANY ENGINES
  116. }
  117.  
  118. var y = function () {
  119. console.log('y');
  120. };
  121.  
  122. var z = function w() {
  123. console.log('zw')
  124. };
  125.  
  126. var z = function w() {
  127. console.log(typeof w); // "function"
  128. };
  129. console.log(typeof w); // "undefined"
  130.  
  131. var obj = {
  132. value: 0,
  133. get f() {
  134. return this.value;
  135. },
  136. set f(v) {
  137. this.value = v;
  138. }
  139. };
  140. console.log(obj.f); // 0
  141. console.log(typeof obj.f); // "number"
  142.  
  143. var a = [1, 2, 3];
  144. var b = a.map(n => n * 2);
  145. console.log(b.join(", ")); // 2, 4, 6
  146.  
  147. var a = [1, 2, 3];
  148. var b = a.map((n, i) => n * i);
  149. console.log(b.join(", ")); // 0, 2, 6
  150.  
  151. var a = [
  152. {first: "Joe", last: "Bloggs"},
  153. {first: "Albert", last: "Bloggs"},
  154. {first: "Mary", last: "Albright"}
  155. ];
  156. a = a.sort((a, b) => {
  157. var rv = a.last.localeCompare(b.last);
  158. if (rv === 0) {
  159. rv = a.first.localeCompare(b.first);
  160. }
  161. return rv;
  162. });
  163. console.log(JSON.stringify(a));
  164.  
  165. class Person {
  166. constructor(firstName, lastName) {
  167. this.firstName = firstName;
  168. this.lastName = lastName;
  169. }
  170.  
  171. getFullName() {
  172. return this.firstName + " " + this.lastName;
  173. }
  174. }
  175.  
  176. alert(typeof foo); // 'function', it's already available
  177. alert(typeof bar); // 'undefined'
  178. function foo () {}
  179. var bar = function () {};
  180. alert(typeof bar); // 'function'
  181.  
  182. function test () {}
  183. test = null;
  184.  
  185. (function(){
  186. var exports = {};
  187.  
  188. function privateUtil() {
  189. ...
  190. }
  191.  
  192. exports.publicUtil = function() {
  193. ...
  194. };
  195.  
  196. return exports;
  197. })();
  198.  
  199. functionTwo();
  200. function functionTwo() {
  201. }
  202.  
  203. functionOne(); --------------- var functionOne;
  204. | is actually | functionOne();
  205. var functionOne = function(){ | interpreted |-->
  206. }; | like | functionOne = function(){
  207. --------------- };
  208.  
  209. functionTwo(); --------------- function functionTwo() {
  210. | is actually | };
  211. function functionTwo() { | interpreted |-->
  212. } | like | functionTwo();
  213. ---------------
  214.  
  215. if (condition){
  216. function myfunction(){
  217. // some code
  218. }
  219. }
  220.  
  221. if (condition){
  222. var myfunction = function (){
  223. // some code
  224. }
  225. }
  226.  
  227. var MyNamespace = {}
  228. MyNamespace.foo= function() {
  229.  
  230. }
  231.  
  232. var MyNamespace {
  233. foo: function() {
  234. },
  235. ...
  236. }
  237.  
  238. var foo = 1;
  239. function bar() {
  240. if (!foo) {
  241. var foo = 10 }
  242. return foo; }
  243. bar() // 10
  244.  
  245. function f() {
  246. return a;
  247. function a() {return 1};
  248. var a = 4;
  249. function a() {return 2}}
  250. f()() // 2
  251.  
  252. function f() {
  253. return a;
  254. var a = 4;
  255. function a() {return 1};
  256. function a() {return 2}}
  257. f()() // 2
  258.  
  259. function f() {
  260. var a = 4;
  261. function a() {return 1};
  262. function a() {return 2};
  263. return a; }
  264. f() // 4
  265.  
  266. var a = 1;
  267. function b() {
  268. a = 10;
  269. return;
  270. function a() {}}
  271. b();
  272. a // 1
  273.  
  274. function abc(){}
  275.  
  276. var abc = function() {};
  277.  
  278. //this will work
  279. abc(param);
  280. function abc(){}
  281.  
  282. //this would fail
  283. abc(param);
  284. var abc = function() {}
  285.  
  286. {
  287. member:function() { /* How do I make "this.member" a named function? */
  288. }
  289. }
  290.  
  291. var ninja = {
  292. yell: function(n){
  293. return n > 0 ? ninja.yell(n-1) + "a" : "hiy";
  294. }
  295. };
  296. assert( ninja.yell(4) == "hiyaaaa", "A single object isn't too bad, either." );
  297.  
  298. var samurai = { yell: ninja.yell };
  299. var ninja = null;
  300.  
  301. try {
  302. samurai.yell(4);
  303. } catch(e){
  304. assert( false, "Uh, this isn't good! Where'd ninja.yell go?" );
  305. }
  306.  
  307. var ninja = {
  308. yell: function yell(n){
  309. return n > 0 ? yell(n-1) + "a" : "hiy";
  310. }
  311. };
  312. assert( ninja.yell(4) == "hiyaaaa", "Works as we would expect it to!" );
  313.  
  314. var samurai = { yell: ninja.yell };
  315. var ninja = {};
  316. assert( samurai.yell(4) == "hiyaaaa", "The method correctly calls itself." );
  317.  
  318. var objectOne = new functionOne();
  319. console.log(objectOne.__proto__); // prints "Object {}" because constructor is an anonymous function
  320.  
  321. var objectTwo = new functionTwo();
  322. console.log(objectTwo.__proto__); // prints "functionTwo {}" because constructor is a named function
  323.  
  324. global_Page = 10; var global_Page; « undefined
  325. « Integer literal, Number Type. ------------------- global_Page = 10; « Number
  326. global_Page = 'Yash'; | Interpreted | global_Page = 'Yash'; « String
  327. « String literal, String Type. « AS « global_Page = true; « Boolean
  328. var global_Page = true; | | global_Page = function (){ « function
  329. « Boolean Type ------------------- var local_functionblock; « undefined
  330. global_Page = function (){ local_functionblock = 777;« Number
  331. var local_functionblock = 777; };
  332. // Assigning function as a data.
  333. };
  334.  
  335. function Identifier_opt ( FormalParameterList_opt ) {
  336. FunctionBody | sequence of statements
  337.  
  338. « return; Default undefined
  339. « return 'some data';
  340. }
  341.  
  342. Scope with respect to function-block global.
  343. Scope with respect to page undefined | not available.
  344.  
  345. function globalAccess() { function globalAccess() {
  346. } ------------------- }
  347. globalAccess(); | | function globalAccess() { « Re-Defined / overridden.
  348. localAccess(); « Hoisted As « function localAccess() {
  349. function globalAccess() { | | }
  350. localAccess(); ------------------- localAccess(); « function accessed with in globalAccess() only.
  351. function localAccess() { }
  352. } globalAccess();
  353. } localAccess(); « ReferenceError as the function is not defined
  354.  
  355. 10; « literal
  356. (10); « Expression (10).toString() -> '10'
  357. var a;
  358. a = 10; « Expression var a.toString() -> '10'
  359. (function invoke() { « Expression Function
  360. console.log('Self Invoking'); (function () {
  361. }); }) () -> 'Self Invoking'
  362.  
  363. var f;
  364. f = function (){ « Expression var Function
  365. console.log('var Function'); f () -> 'var Function'
  366. };
  367.  
  368. (function selfExecuting(){
  369. console.log('IIFE - Immediately-Invoked Function Expression');
  370. }());
  371.  
  372. var anonymous = function (){
  373. console.log('anonymous function Expression');
  374. };
  375.  
  376. var namedExpression = function for_InternalUSE(fact){
  377. if(fact === 1){
  378. return 1;
  379. }
  380.  
  381. var localExpression = function(){
  382. console.log('Local to the parent Function Scope');
  383. };
  384. globalExpression = function(){
  385. console.log('creates a new global variable, then assigned this function.');
  386. };
  387.  
  388. //return; //undefined.
  389. return fact * for_InternalUSE( fact - 1);
  390. };
  391.  
  392. namedExpression();
  393. globalExpression();
  394.  
  395. var anonymous;
  396. var namedExpression;
  397. var globalExpression;
  398.  
  399. anonymous = function (){
  400. console.log('anonymous function Expression');
  401. };
  402.  
  403. namedExpression = function for_InternalUSE(fact){
  404. var localExpression;
  405.  
  406. if(fact === 1){
  407. return 1;
  408. }
  409. localExpression = function(){
  410. console.log('Local to the parent Function Scope');
  411. };
  412. globalExpression = function(){
  413. console.log('creates a new global variable, then assigned this function.');
  414. };
  415.  
  416. return fact * for_InternalUSE( fact - 1); // DEFAULT UNDEFINED.
  417. };
  418.  
  419. namedExpression(10);
  420. globalExpression();
  421.  
  422. var functionOne = function() {
  423. // Some code
  424. };
  425.  
  426. var one = new functionOne();
  427.  
  428. function functionTwo() {
  429. // Some code
  430. }
  431. two = new functionTwo();
  432.  
  433. var foo = function foo() {};
  434.  
  435. function foo() {};
  436.  
  437. function foo() {};
  438.  
  439. var foo = function foo() {};
  440.  
  441. var foo = undefined;
  442. foo = function foo() {};
  443.  
  444. function foo() {
  445. return 3;
  446. }
  447.  
  448. // Anonymous function expression
  449. var a = function() {
  450. return 3;
  451. }
  452.  
  453. // Named function expression
  454. var a = function foo() {
  455. return 3;
  456. }
  457.  
  458. // Self-invoking function expression
  459. (function foo() {
  460. alert("hello!");
  461. })();
  462.  
  463. function outerFunction() {
  464. function foo() {
  465. return 1;
  466. }
  467. return foo();
  468. function foo() {
  469. return 2;
  470. }
  471. }
  472. alert(outerFunction()); // Displays 2
  473.  
  474. function foo() { // The first function declaration is moved to top
  475. return 1;
  476. }
  477. function foo() { // The second function declaration is moved to top
  478. return 2;
  479. }
  480. function outerFunction() {
  481. return foo();
  482. }
  483. alert(outerFunction()); //So executing from top to bottom,
  484. //the last foo() returns 2 which gets displayed
  485.  
  486. function outerFunction() {
  487. var foo = function() {
  488. return 1;
  489. }
  490. return foo();
  491. var foo = function() {
  492. return 2;
  493. }
  494. }
  495. alert(outerFunction()); // Displays 1
  496.  
  497. function outerFunction() {
  498. var foo = undefined;
  499. var foo = undefined;
  500.  
  501. foo = function() {
  502. return 1;
  503. };
  504. return foo ();
  505. foo = function() { // This function expression is not reachable
  506. return 2;
  507. };
  508. }
  509. alert(outerFunction()); // Displays 1
  510.  
  511. if (test) {
  512. function x() { doSomething(); }
  513. }
  514.  
  515. var today = function today() {return new Date()}
  516.  
  517. [].forEach(function iterator() {});
  518.  
  519. 'use strict';
  520.  
  521. var a = function () {
  522. throw new Error();
  523. },
  524. b = function b() {
  525. throw new Error();
  526. },
  527. c = function d() {
  528. throw new Error();
  529. },
  530. e = {
  531. f: a,
  532. g: b,
  533. h: c,
  534. i: function () {
  535. throw new Error();
  536. },
  537. j: function j() {
  538. throw new Error();
  539. },
  540. k: function l() {
  541. throw new Error();
  542. }
  543. },
  544. m = (function () {
  545. return function () {
  546. throw new Error();
  547. };
  548. }()),
  549. n = (function () {
  550. return function n() {
  551. throw new Error();
  552. };
  553. }()),
  554. o = (function () {
  555. return function p() {
  556. throw new Error();
  557. };
  558. }());
  559.  
  560. console.log([a, b, c].concat(Object.keys(e).reduce(function (values, key) {
  561. return values.concat(e[key]);
  562. }, [])).concat([m, n, o]).reduce(function (logs, func) {
  563.  
  564. try {
  565. func();
  566. } catch (error) {
  567. return logs.concat('func.name: ' + func.name + 'n' +
  568. 'Trace:n' +
  569. error.stack);
  570. // Need to manually log the error object in Nitro.
  571. }
  572.  
  573. }, []).join('nn'));
  574.  
  575. func.name:
  576. Trace:
  577. Error
  578. at a (http://localhost:8000/test.js:4:11)
  579. at http://localhost:8000/test.js:47:9
  580. at Array.reduce (native)
  581. at http://localhost:8000/test.js:44:27
  582.  
  583. func.name: b
  584. Trace:
  585. Error
  586. at b (http://localhost:8000/test.js:7:15)
  587. at http://localhost:8000/test.js:47:9
  588. at Array.reduce (native)
  589. at http://localhost:8000/test.js:44:27
  590.  
  591. func.name: d
  592. Trace:
  593. Error
  594. at d (http://localhost:8000/test.js:10:15)
  595. at http://localhost:8000/test.js:47:9
  596. at Array.reduce (native)
  597. at http://localhost:8000/test.js:44:27
  598.  
  599. func.name:
  600. Trace:
  601. Error
  602. at a (http://localhost:8000/test.js:4:11)
  603. at http://localhost:8000/test.js:47:9
  604. at Array.reduce (native)
  605. at http://localhost:8000/test.js:44:27
  606.  
  607. func.name: b
  608. Trace:
  609. Error
  610. at b (http://localhost:8000/test.js:7:15)
  611. at http://localhost:8000/test.js:47:9
  612. at Array.reduce (native)
  613. at http://localhost:8000/test.js:44:27
  614.  
  615. func.name: d
  616. Trace:
  617. Error
  618. at d (http://localhost:8000/test.js:10:15)
  619. at http://localhost:8000/test.js:47:9
  620. at Array.reduce (native)
  621. at http://localhost:8000/test.js:44:27
  622.  
  623. func.name:
  624. Trace:
  625. Error
  626. at e.i (http://localhost:8000/test.js:17:19)
  627. at http://localhost:8000/test.js:47:9
  628. at Array.reduce (native)
  629. at http://localhost:8000/test.js:44:27
  630.  
  631. func.name: j
  632. Trace:
  633. Error
  634. at j (http://localhost:8000/test.js:20:19)
  635. at http://localhost:8000/test.js:47:9
  636. at Array.reduce (native)
  637. at http://localhost:8000/test.js:44:27
  638.  
  639. func.name: l
  640. Trace:
  641. Error
  642. at l (http://localhost:8000/test.js:23:19)
  643. at http://localhost:8000/test.js:47:9
  644. at Array.reduce (native)
  645. at http://localhost:8000/test.js:44:27
  646.  
  647. func.name:
  648. Trace:
  649. Error
  650. at http://localhost:8000/test.js:28:19
  651. at http://localhost:8000/test.js:47:9
  652. at Array.reduce (native)
  653. at http://localhost:8000/test.js:44:27
  654.  
  655. func.name: n
  656. Trace:
  657. Error
  658. at n (http://localhost:8000/test.js:33:19)
  659. at http://localhost:8000/test.js:47:9
  660. at Array.reduce (native)
  661. at http://localhost:8000/test.js:44:27
  662.  
  663. func.name: p
  664. Trace:
  665. Error
  666. at p (http://localhost:8000/test.js:38:19)
  667. at http://localhost:8000/test.js:47:9
  668. at Array.reduce (native)
  669. at http://localhost:8000/test.js:44:27 test.js:42
  670.  
  671. func.name:
  672. Trace:
  673. a@http://localhost:8000/test.js:4:5
  674. @http://localhost:8000/test.js:47:9
  675. @http://localhost:8000/test.js:54:1
  676.  
  677.  
  678. func.name: b
  679. Trace:
  680. b@http://localhost:8000/test.js:7:9
  681. @http://localhost:8000/test.js:47:9
  682. @http://localhost:8000/test.js:54:1
  683.  
  684.  
  685. func.name: d
  686. Trace:
  687. d@http://localhost:8000/test.js:10:9
  688. @http://localhost:8000/test.js:47:9
  689. @http://localhost:8000/test.js:54:1
  690.  
  691.  
  692. func.name:
  693. Trace:
  694. a@http://localhost:8000/test.js:4:5
  695. @http://localhost:8000/test.js:47:9
  696. @http://localhost:8000/test.js:54:1
  697.  
  698.  
  699. func.name: b
  700. Trace:
  701. b@http://localhost:8000/test.js:7:9
  702. @http://localhost:8000/test.js:47:9
  703. @http://localhost:8000/test.js:54:1
  704.  
  705.  
  706. func.name: d
  707. Trace:
  708. d@http://localhost:8000/test.js:10:9
  709. @http://localhost:8000/test.js:47:9
  710. @http://localhost:8000/test.js:54:1
  711.  
  712.  
  713. func.name:
  714. Trace:
  715. e.i@http://localhost:8000/test.js:17:13
  716. @http://localhost:8000/test.js:47:9
  717. @http://localhost:8000/test.js:54:1
  718.  
  719.  
  720. func.name: j
  721. Trace:
  722. j@http://localhost:8000/test.js:20:13
  723. @http://localhost:8000/test.js:47:9
  724. @http://localhost:8000/test.js:54:1
  725.  
  726.  
  727. func.name: l
  728. Trace:
  729. l@http://localhost:8000/test.js:23:13
  730. @http://localhost:8000/test.js:47:9
  731. @http://localhost:8000/test.js:54:1
  732.  
  733.  
  734. func.name:
  735. Trace:
  736. m</<@http://localhost:8000/test.js:28:13
  737. @http://localhost:8000/test.js:47:9
  738. @http://localhost:8000/test.js:54:1
  739.  
  740.  
  741. func.name: n
  742. Trace:
  743. n@http://localhost:8000/test.js:33:13
  744. @http://localhost:8000/test.js:47:9
  745. @http://localhost:8000/test.js:54:1
  746.  
  747.  
  748. func.name: p
  749. Trace:
  750. p@http://localhost:8000/test.js:38:13
  751. @http://localhost:8000/test.js:47:9
  752. @http://localhost:8000/test.js:54:1
  753.  
  754. func.name: undefined
  755. Trace:
  756. Error
  757. at a (http://localhost:8000/test.js:4:5)
  758. at Anonymous function (http://localhost:8000/test.js:47:9)
  759. at Global code (http://localhost:8000/test.js:42:1)
  760.  
  761.  
  762. func.name: undefined
  763. Trace:
  764. Error
  765. at b (http://localhost:8000/test.js:7:9)
  766. at Anonymous function (http://localhost:8000/test.js:47:9)
  767. at Global code (http://localhost:8000/test.js:42:1)
  768.  
  769.  
  770. func.name: undefined
  771. Trace:
  772. Error
  773. at d (http://localhost:8000/test.js:10:9)
  774. at Anonymous function (http://localhost:8000/test.js:47:9)
  775. at Global code (http://localhost:8000/test.js:42:1)
  776.  
  777.  
  778. func.name: undefined
  779. Trace:
  780. Error
  781. at a (http://localhost:8000/test.js:4:5)
  782. at Anonymous function (http://localhost:8000/test.js:47:9)
  783. at Global code (http://localhost:8000/test.js:42:1)
  784.  
  785.  
  786. func.name: undefined
  787. Trace:
  788. Error
  789. at b (http://localhost:8000/test.js:7:9)
  790. at Anonymous function (http://localhost:8000/test.js:47:9)
  791. at Global code (http://localhost:8000/test.js:42:1)
  792.  
  793.  
  794. func.name: undefined
  795. Trace:
  796. Error
  797. at d (http://localhost:8000/test.js:10:9)
  798. at Anonymous function (http://localhost:8000/test.js:47:9)
  799. at Global code (http://localhost:8000/test.js:42:1)
  800.  
  801.  
  802. func.name: undefined
  803. Trace:
  804. Error
  805. at e.i (http://localhost:8000/test.js:17:13)
  806. at Anonymous function (http://localhost:8000/test.js:47:9)
  807. at Global code (http://localhost:8000/test.js:42:1)
  808.  
  809.  
  810. func.name: undefined
  811. Trace:
  812. Error
  813. at j (http://localhost:8000/test.js:20:13)
  814. at Anonymous function (http://localhost:8000/test.js:47:9)
  815. at Global code (http://localhost:8000/test.js:42:1)
  816.  
  817.  
  818. func.name: undefined
  819. Trace:
  820. Error
  821. at l (http://localhost:8000/test.js:23:13)
  822. at Anonymous function (http://localhost:8000/test.js:47:9)
  823. at Global code (http://localhost:8000/test.js:42:1)
  824.  
  825.  
  826. func.name: undefined
  827. Trace:
  828. Error
  829. at Anonymous function (http://localhost:8000/test.js:28:13)
  830. at Anonymous function (http://localhost:8000/test.js:47:9)
  831. at Global code (http://localhost:8000/test.js:42:1)
  832.  
  833.  
  834. func.name: undefined
  835. Trace:
  836. Error
  837. at n (http://localhost:8000/test.js:33:13)
  838. at Anonymous function (http://localhost:8000/test.js:47:9)
  839. at Global code (http://localhost:8000/test.js:42:1)
  840.  
  841.  
  842. func.name: undefined
  843. Trace:
  844. Error
  845. at p (http://localhost:8000/test.js:38:13)
  846. at Anonymous function (http://localhost:8000/test.js:47:9)
  847. at Global code (http://localhost:8000/test.js:42:1)
  848.  
  849. func.name:
  850. Trace:
  851. a@http://localhost:8000/test.js:4:22
  852. http://localhost:8000/test.js:47:13
  853. reduce@[native code]
  854. global code@http://localhost:8000/test.js:44:33
  855.  
  856. func.name: b
  857. Trace:
  858. b@http://localhost:8000/test.js:7:26
  859. http://localhost:8000/test.js:47:13
  860. reduce@[native code]
  861. global code@http://localhost:8000/test.js:44:33
  862.  
  863. func.name: d
  864. Trace:
  865. d@http://localhost:8000/test.js:10:26
  866. http://localhost:8000/test.js:47:13
  867. reduce@[native code]
  868. global code@http://localhost:8000/test.js:44:33
  869.  
  870. func.name:
  871. Trace:
  872. a@http://localhost:8000/test.js:4:22
  873. http://localhost:8000/test.js:47:13
  874. reduce@[native code]
  875. global code@http://localhost:8000/test.js:44:33
  876.  
  877. func.name: b
  878. Trace:
  879. b@http://localhost:8000/test.js:7:26
  880. http://localhost:8000/test.js:47:13
  881. reduce@[native code]
  882. global code@http://localhost:8000/test.js:44:33
  883.  
  884. func.name: d
  885. Trace:
  886. d@http://localhost:8000/test.js:10:26
  887. http://localhost:8000/test.js:47:13
  888. reduce@[native code]
  889. global code@http://localhost:8000/test.js:44:33
  890.  
  891. func.name:
  892. Trace:
  893. i@http://localhost:8000/test.js:17:30
  894. http://localhost:8000/test.js:47:13
  895. reduce@[native code]
  896. global code@http://localhost:8000/test.js:44:33
  897.  
  898. func.name: j
  899. Trace:
  900. j@http://localhost:8000/test.js:20:30
  901. http://localhost:8000/test.js:47:13
  902. reduce@[native code]
  903. global code@http://localhost:8000/test.js:44:33
  904.  
  905. func.name: l
  906. Trace:
  907. l@http://localhost:8000/test.js:23:30
  908. http://localhost:8000/test.js:47:13
  909. reduce@[native code]
  910. global code@http://localhost:8000/test.js:44:33
  911.  
  912. func.name:
  913. Trace:
  914. http://localhost:8000/test.js:28:30
  915. http://localhost:8000/test.js:47:13
  916. reduce@[native code]
  917. global code@http://localhost:8000/test.js:44:33
  918.  
  919. func.name: n
  920. Trace:
  921. n@http://localhost:8000/test.js:33:30
  922. http://localhost:8000/test.js:47:13
  923. reduce@[native code]
  924. global code@http://localhost:8000/test.js:44:33
  925.  
  926. func.name: p
  927. Trace:
  928. p@http://localhost:8000/test.js:38:30
  929. http://localhost:8000/test.js:47:13
  930. reduce@[native code]
  931. global code@http://localhost:8000/test.js:44:33
  932.  
  933. functionOne();
  934. var functionOne = function() {
  935. // Some code
  936. };
  937.  
  938. functionOne();
  939. function functionOne() {
  940. // Some code
  941. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement