@ -26,40 +26,42 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// Node polyfill
// Node polyfill
var fs = require ( 'fs' ) ;
const fs = require ( 'fs' ) ;
var os = {
const cp = require ( 'child_process' ) ;
const os = {
system : function ( name , args ) {
system : function ( name , args ) {
if ( process . platform === 'linux' && name === 'nm' ) {
if ( process . platform === 'linux' && name === 'nm' ) {
// Filter out vdso and vsyscall entries.
// Filter out vdso and vsyscall entries.
var arg = args [ args . length - 1 ] ;
const arg = args [ args . length - 1 ] ;
if ( arg === '[vdso]' ||
if ( arg === '[vdso]' ||
arg == '[vsyscall]' ||
arg == '[vsyscall]' ||
/^[0-9a-f]+-[0-9a-f]+$/ . test ( arg ) ) {
/^[0-9a-f]+-[0-9a-f]+$/ . test ( arg ) ) {
return '' ;
return '' ;
}
}
} else if ( process . platform === 'darwin' ) {
args . unshift ( '-c' , name ) ;
name = '/bin/sh' ;
}
}
return require ( 'child_process' ) . execFileSync (
return cp . spawnSync ( name , args ) . stdout . toString ( ) ;
name , args , { encoding : 'utf8' } ) ;
}
}
} ;
} ;
var print = console . log ;
const print = console . log ;
function read ( fileName ) {
function read ( fileName ) {
return fs . readFileSync ( fileName , 'utf8' ) ;
return fs . readFileSync ( fileName , 'utf8' ) ;
}
}
arguments = process . argv . slice ( 2 ) ;
const quit = process . exit ;
var quit = process . exit ;
// Polyfill "readline()".
// Polyfill "readline()".
var logFile = arguments [ arguments . length - 1 ] ;
const logFile = arguments [ arguments . length - 1 ] ;
try {
try {
fs . accessSync ( logFile ) ;
fs . accessSync ( logFile ) ;
} catch ( e ) {
} catch ( e ) {
console . error ( 'Please provide a valid isolate file as the final argument.' ) ;
console . error ( 'Please provide a valid isolate file as the final argument.' ) ;
process . exit ( 1 ) ;
process . exit ( 1 ) ;
}
}
var fd = fs . openSync ( logFile , 'r' ) ;
const fd = fs . openSync ( logFile , 'r' ) ;
var buf = new Buffer ( 4096 ) ;
const buf = new Buffer ( 4096 ) ;
var dec = new ( require ( 'string_decoder' ) . StringDecoder ) ( 'utf-8' ) ;
const dec = new ( require ( 'string_decoder' ) . StringDecoder ) ( 'utf-8' ) ;
var line = '' ;
var line = '' ;
versionCheck ( ) ;
versionCheck ( ) ;
function readline ( ) {
function readline ( ) {
@ -85,7 +87,7 @@ function versionCheck() {
var firstLine = readline ( ) ;
var firstLine = readline ( ) ;
line = firstLine + '\n' + line ;
line = firstLine + '\n' + line ;
firstLine = firstLine . split ( ',' ) ;
firstLine = firstLine . split ( ',' ) ;
var curVer = process . versions . v8 . split ( '.' ) ;
const curVer = process . versions . v8 . split ( '.' ) ;
if ( firstLine . length !== 6 && firstLine [ 0 ] !== 'v8-version' ) {
if ( firstLine . length !== 6 && firstLine [ 0 ] !== 'v8-version' ) {
console . log ( 'Unable to read v8-version from log file.' ) ;
console . log ( 'Unable to read v8-version from log file.' ) ;
return ;
return ;