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