1// Copyright 2020 the V8 project authors. All rights reserved. 2// Use of this source code is governed by a BSD-style license that can be 3// found in the LICENSE file. 4 5// Minimally stub out methods from JSTest's standalone-pre.js. 6function description(msg) {} 7function debug(msg) {} 8 9function shouldBe(_a) { 10 print((typeof _a == "function" ? _a() : eval(_a))); 11} 12 13function shouldBeTrue(_a) { shouldBe(_a); } 14function shouldBeFalse(_a) { shouldBe(_a); } 15function shouldBeNaN(_a) { shouldBe(_a); } 16function shouldBeNull(_a) { shouldBe(_a); } 17function shouldNotThrow(_a) { shouldBe(_a); } 18function shouldThrow(_a) { shouldBe(_a); } 19 20function noInline() {} 21function finishJSTest() {} 22 23// Stub out $vm. 24try { 25 $vm; 26} catch(e) { 27 const handler = { 28 get: function(x, prop) { 29 if (prop == Symbol.toPrimitive) { 30 return function() { return undefined; }; 31 } 32 return dummy; 33 }, 34 }; 35 const dummy = new Proxy(function() { return dummy; }, handler); 36 this.$vm = dummy; 37} 38 39// Other functions. 40function ensureArrayStorage() {} 41function transferArrayBuffer() {} 42