xref: /third_party/node/test/fixtures/policy-manifest/object-define-property-bypass.js (revision 1cb0ef41)
  • Home
  • History
  • Annotate Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
  • only in /third_party/node/test/fixtures/policy-manifest/
11cb0ef41Sopenharmony_cilet requires = new WeakMap()
21cb0ef41Sopenharmony_ciObject.defineProperty(Object.getPrototypeOf(module), 'require', {
31cb0ef41Sopenharmony_ci  get() {
41cb0ef41Sopenharmony_ci    return requires.get(this);
51cb0ef41Sopenharmony_ci  },
61cb0ef41Sopenharmony_ci  set(v) {
71cb0ef41Sopenharmony_ci    requires.set(this, v);
81cb0ef41Sopenharmony_ci    process.nextTick(() => {
91cb0ef41Sopenharmony_ci      let fs = Reflect.apply(v, this, ['fs'])
101cb0ef41Sopenharmony_ci      if (typeof fs.readFileSync === 'function') {
111cb0ef41Sopenharmony_ci        process.exit(1);
121cb0ef41Sopenharmony_ci      }
131cb0ef41Sopenharmony_ci    })
141cb0ef41Sopenharmony_ci    return requires.get(this);
151cb0ef41Sopenharmony_ci  },
161cb0ef41Sopenharmony_ci  configurable: true
171cb0ef41Sopenharmony_ci})
181cb0ef41Sopenharmony_ci
191cb0ef41Sopenharmony_cirequire('./valid-module')
20

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