xref: /third_party/node/test/parallel/test-vm-set-proto-null-on-globalthis.js
  • Home
  • History
  • Annotate Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
  • only in /third_party/node/test/parallel/
11cb0ef41Sopenharmony_ci'use strict';
21cb0ef41Sopenharmony_cirequire('../common');
31cb0ef41Sopenharmony_ci
41cb0ef41Sopenharmony_ci// Setting __proto__ on vm context's globalThis should not cause a crash
51cb0ef41Sopenharmony_ci// Regression test for https://github.com/nodejs/node/issues/47798
61cb0ef41Sopenharmony_ci
71cb0ef41Sopenharmony_ciconst vm = require('vm');
81cb0ef41Sopenharmony_ciconst context = vm.createContext();
91cb0ef41Sopenharmony_ci
101cb0ef41Sopenharmony_ciconst contextGlobalThis = vm.runInContext('this', context);
111cb0ef41Sopenharmony_ci
121cb0ef41Sopenharmony_ci// Should not crash.
131cb0ef41Sopenharmony_cicontextGlobalThis.__proto__ = null; // eslint-disable-line no-proto
14

Indexes created Thu Nov 07 10:32:03 CST 2024