/
githubmirror
/
node
Обзор
Документация
Войти
/
githubmirror
/
node
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
deps/v8/test/debugger/debug/side-effect/debug-evaluate-no-side-effect-array-fill.js
41 строка
980 B
Michaël Zasso
deps: update V8 to 11.8.172.13
10 окт 2023, 09:25
Не верифицирован
10 окт 2023, 09:25
17a74dd
Код
Авторство
О чём код?
// Copyright 2023 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: --no-enable-one-shot-optimization Debug = debug.Debug var exception = null; var array = [1,2,3]; function listener(event, exec_state, event_data, data) { if (event != Debug.DebugEvent.Break) return; try { function success(expectation, source) { var result = exec_state.frame(0).evaluate(source, true).value(); if (expectation !== undefined) assertEquals(expectation, result); } function fail(source) { assertThrows(() => exec_state.frame(0).evaluate(source, true), EvalError); } fail(`array.fill(1)`); success([1, 1, 1], `[1, 2, 3].fill(1)`); } catch (e) { exception = e; print(e, e.stack); }; }; // Add the debug event listener. Debug.setListener(listener); function f() { debugger; }; f(); assertNull(exception);