mirror of
				https://github.com/tc39/test262.git
				synced 2025-11-03 21:24:30 +01:00 
			
		
		
		
	sourceRevisionAtLastExport: 33f2fb0e53d135f0ee17cfccd9d993eb2a6f47de targetRevisionAtLastExport: 31340cbd9add103f586d501b0c3354b7b182abc0
		
			
				
	
	
		
			40 lines
		
	
	
		
			1.2 KiB
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			40 lines
		
	
	
		
			1.2 KiB
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
// Copyright 2017 the V8 project authors. All rights reserved.
 | 
						|
// Use of this source code is governed by a BSD-style license that can be
 | 
						|
// found in the LICENSE file.
 | 
						|
 | 
						|
// Flags: --expose-wasm --wasm-interpret-all
 | 
						|
 | 
						|
load('test/mjsunit/wasm/wasm-constants.js');
 | 
						|
load('test/mjsunit/wasm/wasm-module-builder.js');
 | 
						|
 | 
						|
assertThrows(() => {
 | 
						|
 __v_29 = 0;
 | 
						|
function __f_1() {
 | 
						|
 __v_19 = new WasmModuleBuilder();
 | 
						|
  if (__v_25) {
 | 
						|
 __v_23 = __v_19.addImport('__v_24', '__v_30', __v_25);
 | 
						|
  }
 | 
						|
  if (__v_18) {
 | 
						|
 __v_19.addMemory();
 | 
						|
 __v_19.addFunction('load', kSig_i_i)
 | 
						|
        .addBody([ 0])
 | 
						|
        .exportFunc();
 | 
						|
  }
 | 
						|
 return __v_19;
 | 
						|
}
 | 
						|
 (function TestExternalCallBetweenTwoWasmModulesWithoutAndWithMemory() {
 | 
						|
 __v_21 = __f_1(__v_18 = false, __v_25 = kSig_i_i);
 | 
						|
 __v_21.addFunction('plus_one', kSig_i_i)
 | 
						|
      .addBody([
 | 
						|
        kExprGetLocal, 0,                   // -
 | 
						|
        kExprCallFunction, __v_29      ])
 | 
						|
      .exportFunc();
 | 
						|
 __v_32 =
 | 
						|
      __f_1(__v_18 = true, __v_25 = undefined);
 | 
						|
 __v_31 = __v_32.instantiate(); try { __v_32[__getRandomProperty()] = __v_0; delete __v_18[__getRandomProperty()]; delete __v_34[__getRandomProperty()]; } catch(e) {; };
 | 
						|
 __v_20 = __v_21.instantiate(
 | 
						|
      {__v_24: {__v_30: __v_31.exports.load}});
 | 
						|
 __v_20.exports.plus_one(); __v_33 = __v_43;
 | 
						|
})();
 | 
						|
});
 |