mirror of
https://github.com/phpv8/v8js.git
synced 2024-12-22 12:51:52 +00:00
54e3a07bc8
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.
29 lines
568 B
PHP
29 lines
568 B
PHP
--TEST--
|
|
Test V8::executeString() : Test getJsStartColumn on script exception
|
|
--SKIPIF--
|
|
<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?>
|
|
--FILE--
|
|
<?php
|
|
$v8 = new V8Js();
|
|
|
|
// V8 started to return different start column numbers,
|
|
// hence let's do two errors and just look at the offset
|
|
|
|
try {
|
|
$v8->executeString("print(blar());");
|
|
}
|
|
catch(V8JsScriptException $a) { }
|
|
|
|
try {
|
|
$v8->executeString("(null); print(blar());");
|
|
}
|
|
catch(V8JsScriptException $b) { }
|
|
|
|
var_dump($b->getJsStartColumn() - $a->getJsStartColumn());
|
|
|
|
?>
|
|
===EOF===
|
|
--EXPECT--
|
|
int(8)
|
|
===EOF===
|