/
githubmirror
/
node
Обзор
Документация
Войти
/
githubmirror
/
node
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
deps/v8/test/mjsunit/baseline/verify-bytecode-offsets.js
37 строк
1 KB
Michaël Zasso
deps: update V8 to 9.1.269.36
10 июн 2021, 12:10
Не верифицирован
10 июн 2021, 12:10
a7cbf19
Код
Авторство
О чём код?
// Copyright 2021 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: --always-sparkplug --allow-natives-syntax // This test mainly exists to make ClusterFuzz aware of // d8.test.verifySourcePositions. globalValue = false; function foo(param1, ...param2) { try { for (let key in param1) { param2.push(key); } for (let a of param1) { param2.push(a); } let [a, b] = param2; let copy = [{literal:1}, {}, [], [1], 1, ...param2]; return a + b + copy.length; } catch (e) { return e.toString().match(/[a-zA-Z]+/g); } finally { globalValue = new String(23); } return Math.min(Math.random(), 0.5); } var obj = [...Array(10).keys()]; obj.foo = 'bar'; foo(obj, obj); d8.test.verifySourcePositions(foo); // Make sure invalid calls throw. assertThrows(() => {d8.test.verifySourcePositions(0)}); assertThrows(() => {d8.test.verifySourcePositions(obj)}); assertThrows(() => {d8.test.verifySourcePositions(new Proxy(foo, {}))}); assertThrows(() => {d8.test.verifySourcePositions(%GetUndetectable())});