mirror of
				https://github.com/tc39/test262.git
				synced 2025-10-31 11:44:31 +01:00 
			
		
		
		
	* [javascriptcore-test262-automation] changes from git@github.com:WebKit/webkit.git at sha 949e26452cfa153a7f4afe593da97e2fe9e1b706 on Tue Jul 03 2018 14:35:15 GMT-0400 (Eastern Daylight Time)
		
			
				
	
	
		
			47 lines
		
	
	
		
			1.3 KiB
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			47 lines
		
	
	
		
			1.3 KiB
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
| const file = "175693.wasm";
 | |
| 
 | |
| const verbose = false;
 | |
| 
 | |
| if (typeof console === 'undefined') {
 | |
|     console = { log: print };
 | |
| }
 | |
| var binary;
 | |
| if (typeof process === 'object' && typeof require === 'function' /* node.js detection */) {
 | |
|     var args = process.argv.slice(2);
 | |
|     binary = require('fs').readFileSync(file);
 | |
|     if (!binary.buffer) binary = new Uint8Array(binary);
 | |
| } else {
 | |
|     var args;
 | |
|     if (typeof scriptArgs != 'undefined') {
 | |
|         args = scriptArgs;
 | |
|     } else if (typeof arguments != 'undefined') {
 | |
|         args = arguments;
 | |
|     }
 | |
|     if (typeof readbuffer === 'function') {
 | |
|         binary = new Uint8Array(readbuffer(file));
 | |
|     } else {
 | |
|         binary = read(file, 'binary');
 | |
|     }
 | |
| }
 | |
| var instance = new WebAssembly.Instance(new WebAssembly.Module(binary), {});
 | |
| if (instance.exports.hangLimitInitializer) instance.exports.hangLimitInitializer();
 | |
| try {
 | |
|     if (verbose)
 | |
|         console.log('calling: func_0');
 | |
|     instance.exports.func_0();
 | |
| } catch (e) {
 | |
|     if (verbose)
 | |
|         console.log('   exception: ' + e);
 | |
| }
 | |
| if (instance.exports.hangLimitInitializer) instance.exports.hangLimitInitializer();
 | |
| try {
 | |
|     if (verbose)
 | |
|         console.log('calling: hangLimitInitializer');
 | |
|     instance.exports.hangLimitInitializer();
 | |
| } catch (e) {
 | |
|     if (verbose)
 | |
|         console.log('   exception: ' + e);
 | |
| }
 | |
| if (verbose)
 | |
|     console.log('done.')
 |