Browse Source

add simulated Duktape.line() to Duktape.act() test

pull/2/head
Sami Vaarala 11 years ago
parent
commit
fe6bdb693f
  1. 19
      ecmascript-testcases/test-bi-duktape-act.js

19
ecmascript-testcases/test-bi-duktape-act.js

@ -1,10 +1,10 @@
/*=== /*===
-1 0 act -1 0 act
-2 10 test -2 10 basicTest
-3 21 global -3 21 global
===*/ ===*/
function test() { function basicTest() {
var i, t; var i, t;
for (i = -1; ; i--) { for (i = -1; ; i--) {
t = Duktape.act(i); t = Duktape.act(i);
@ -18,7 +18,20 @@ function test() {
} }
try { try {
test(); basicTest();
} catch (e) { } catch (e) {
print(e); print(e);
} }
/*===
running on line: 37
===*/
/* Simulate Duktape.line(). */
function getCurrentLine() {
// indices: -1 = Duktape.act, -2 = getCurrentLine, -3 = caller
var a = Duktape.act(-3) || {};
return a.lineNumber;
}
print('running on line:', getCurrentLine());

Loading…
Cancel
Save