stackframe-tests.ts 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /// <reference path="stackframe.d.ts"/>
  2. // Create StackFrame and set properties
  3. var stackFrame = new StackFrame({
  4. functionName: 'funName',
  5. args: ['args'],
  6. fileName: 'http://localhost:3000/file.js',
  7. lineNumber: 1,
  8. columnNumber: 3288,
  9. isEval: true,
  10. isNative: false,
  11. source: 'ORIGINAL_STACK_LINE'
  12. });
  13. stackFrame.functionName; // => "funName"
  14. stackFrame.setFunctionName('newName');
  15. stackFrame.getFunctionName(); // => "newName"
  16. stackFrame.args; // => ["args"]
  17. stackFrame.setArgs([]);
  18. stackFrame.getArgs(); // => []
  19. stackFrame.fileName; // => 'http://localhost:3000/file.min.js'
  20. stackFrame.setFileName('http://localhost:3000/file.js');
  21. stackFrame.getFileName(); // => 'http://localhost:3000/file.js'
  22. stackFrame.lineNumber; // => 1
  23. stackFrame.setLineNumber(325);
  24. stackFrame.getLineNumber(); // => 325
  25. stackFrame.columnNumber; // => 3288
  26. stackFrame.setColumnNumber(20);
  27. stackFrame.getColumnNumber(); // => 20
  28. stackFrame.source; // => 'ORIGINAL_STACK_LINE'
  29. stackFrame.setSource('NEW_SOURCE');
  30. stackFrame.getSource(); // => 'NEW_SOURCE'
  31. stackFrame.isEval; // => true
  32. stackFrame.setIsEval(false);
  33. stackFrame.getIsEval(); // => false
  34. stackFrame.isNative; // => false
  35. stackFrame.setIsNative(true);
  36. stackFrame.getIsNative(); // => true
  37. stackFrame.toString(); // => 'funName(args)@http://localhost:3000/file.js:325:20'