Skip to content

Commit 54e3a07

Browse files
committed
make exception_start_column.phpt green again, closes #302
Test began to fail with V8 ~5.9.35 which started to report different column numbers of errors. Adapt test so it works well with older and newer versions of V8.
1 parent 2dba61f commit 54e3a07

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

tests/exception_start_column.phpt

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,23 @@ Test V8::executeString() : Test getJsStartColumn on script exception
66
<?php
77
$v8 = new V8Js();
88

9+
// V8 started to return different start column numbers,
10+
// hence let's do two errors and just look at the offset
11+
912
try {
1013
$v8->executeString("print(blar());");
1114
}
12-
catch(V8JsScriptException $e) {
13-
var_dump($e->getJsStartColumn());
15+
catch(V8JsScriptException $a) { }
16+
17+
try {
18+
$v8->executeString("(null); print(blar());");
1419
}
20+
catch(V8JsScriptException $b) { }
21+
22+
var_dump($b->getJsStartColumn() - $a->getJsStartColumn());
1523

1624
?>
1725
===EOF===
1826
--EXPECT--
19-
int(6)
27+
int(8)
2028
===EOF===

0 commit comments

Comments
 (0)