mirror of
https://github.com/phpv8/v8js.git
synced 2024-12-22 14:01:53 +00:00
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.
This commit is contained in:
parent
2dba61f036
commit
54e3a07bc8
@ -6,15 +6,23 @@ Test V8::executeString() : Test getJsStartColumn on script exception
|
|||||||
<?php
|
<?php
|
||||||
$v8 = new V8Js();
|
$v8 = new V8Js();
|
||||||
|
|
||||||
|
// V8 started to return different start column numbers,
|
||||||
|
// hence let's do two errors and just look at the offset
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$v8->executeString("print(blar());");
|
$v8->executeString("print(blar());");
|
||||||
}
|
}
|
||||||
catch(V8JsScriptException $e) {
|
catch(V8JsScriptException $a) { }
|
||||||
var_dump($e->getJsStartColumn());
|
|
||||||
|
try {
|
||||||
|
$v8->executeString("(null); print(blar());");
|
||||||
}
|
}
|
||||||
|
catch(V8JsScriptException $b) { }
|
||||||
|
|
||||||
|
var_dump($b->getJsStartColumn() - $a->getJsStartColumn());
|
||||||
|
|
||||||
?>
|
?>
|
||||||
===EOF===
|
===EOF===
|
||||||
--EXPECT--
|
--EXPECT--
|
||||||
int(6)
|
int(8)
|
||||||
===EOF===
|
===EOF===
|
||||||
|
Loading…
Reference in New Issue
Block a user