Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions src/node_builtins.cc
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ namespace node {
namespace builtins {

using v8::Context;
using v8::DEFAULT;
using v8::EscapableHandleScope;
using v8::Function;
using v8::FunctionCallbackInfo;
Expand Down Expand Up @@ -711,15 +710,13 @@ void BuiltinLoader::CreatePerIsolateProperties(IsolateData* isolate_data,
nullptr,
Local<Value>(),
None,
DEFAULT,
SideEffectType::kHasNoSideEffect);

target->SetNativeDataProperty(FIXED_ONE_BYTE_STRING(isolate, "builtinIds"),
BuiltinIdsGetter,
nullptr,
Local<Value>(),
None,
DEFAULT,
SideEffectType::kHasNoSideEffect);

target->SetNativeDataProperty(
Expand All @@ -728,15 +725,13 @@ void BuiltinLoader::CreatePerIsolateProperties(IsolateData* isolate_data,
nullptr,
Local<Value>(),
None,
DEFAULT,
SideEffectType::kHasNoSideEffect);

target->SetNativeDataProperty(FIXED_ONE_BYTE_STRING(isolate, "natives"),
GetNatives,
nullptr,
Local<Value>(),
None,
DEFAULT,
SideEffectType::kHasNoSideEffect);

SetMethod(isolate, target, "getCacheUsage", BuiltinLoader::GetCacheUsage);
Expand Down
29 changes: 18 additions & 11 deletions src/node_process_object.cc
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

namespace node {
using v8::Context;
using v8::DEFAULT;
using v8::EscapableHandleScope;
using v8::Function;
using v8::FunctionCallbackInfo;
Expand Down Expand Up @@ -183,13 +182,12 @@ void PatchProcessObject(const FunctionCallbackInfo<Value>& args) {

// process.title
CHECK(process
->SetAccessor(
->SetNativeDataProperty(
context,
FIXED_ONE_BYTE_STRING(isolate, "title"),
ProcessTitleGetter,
env->owns_process_state() ? ProcessTitleSetter : nullptr,
Local<Value>(),
DEFAULT,
None,
SideEffectType::kHasNoSideEffect)
.FromJust());
Expand All @@ -208,9 +206,15 @@ void PatchProcessObject(const FunctionCallbackInfo<Value>& args) {
READONLY_PROPERTY(process, "pid",
Integer::New(isolate, uv_os_getpid()));

CHECK(process->SetAccessor(context,
FIXED_ONE_BYTE_STRING(isolate, "ppid"),
GetParentProcessId).FromJust());
CHECK(process
->SetNativeDataProperty(context,
FIXED_ONE_BYTE_STRING(isolate, "ppid"),
GetParentProcessId,
nullptr,
Local<Value>(),
None,
SideEffectType::kHasNoSideEffect)
.FromJust());

// --security-revert flags
#define V(code, _, __) \
Expand All @@ -235,11 +239,14 @@ void PatchProcessObject(const FunctionCallbackInfo<Value>& args) {

// process.debugPort
CHECK(process
->SetAccessor(context,
FIXED_ONE_BYTE_STRING(isolate, "debugPort"),
DebugPortGetter,
env->owns_process_state() ? DebugPortSetter : nullptr,
Local<Value>())
->SetNativeDataProperty(
context,
FIXED_ONE_BYTE_STRING(isolate, "debugPort"),
DebugPortGetter,
env->owns_process_state() ? DebugPortSetter : nullptr,
Local<Value>(),
None,
SideEffectType::kHasNoSideEffect)
.FromJust());
}

Expand Down
10 changes: 6 additions & 4 deletions test/parallel/test-worker-unsupported-things.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,16 @@ if (!process.env.HAS_STARTED_WORKER) {
} else {
{
const before = process.title;
process.title += ' in worker';
assert.strictEqual(process.title, before);
const after = before + ' in worker';
process.title = after;
assert.strictEqual(process.title, after);
}

{
const before = process.debugPort;
process.debugPort++;
assert.strictEqual(process.debugPort, before);
const after = before + 1;
process.debugPort = after;
assert.strictEqual(process.debugPort, after);
}

{
Expand Down