| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 866ed6a commit 0d0fad8
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -535,7 +535,8 @@ void ContextifyContext::PropertySetterCallback( | |||
| 535 | 535 | if (is_declared_on_sandbox && | |
| 536 | 536 | ctx->sandbox() | |
| 537 | 537 | ->GetOwnPropertyDescriptor(context, property) | |
| 538 | - .ToLocal(&desc)) { | ||
| 538 | + .ToLocal(&desc) && | ||
| 539 | + !desc->IsUndefined()) { | ||
| 539 | 540 | Environment* env = Environment::GetCurrent(context); | |
| 540 | 541 | Local<Object> desc_obj = desc.As<Object>(); | |
| 541 | 542 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,13 @@ | |||
| 1 | + 'use strict'; | ||
| 2 | + require('../common'); | ||
| 3 | + | ||
| 4 | + // Setting __proto__ on vm context's globalThis should not cause a crash | ||
| 5 | + // Regression test for https://github.com/nodejs/node/issues/47798 | ||
| 6 | + | ||
| 7 | + const vm = require('vm'); | ||
| 8 | + const context = vm.createContext(); | ||
| 9 | + | ||
| 10 | + const contextGlobalThis = vm.runInContext('this', context); | ||
| 11 | + | ||
| 12 | + // Should not crash. | ||
| 13 | + contextGlobalThis.__proto__ = null; // eslint-disable-line no-proto | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments