Skip to content

Commit f8ed673

Browse files
joyeecheungBridgeAR
authored andcommittedNov 13, 2018
src: remove pushValueToArray and SetupProcessObject
The usage of NODE_PUSH_VAL_TO_ARRAY_MAX and push_values_to_array_function has all been removed in favor of the new Array::New API that takes a C++ array. Remove the unused code. PR-URL: #24264 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Daniel Bevenius <[email protected]> Reviewed-By: Refael Ackermann <[email protected]>
1 parent 293983a commit f8ed673

File tree

3 files changed

+1
-22
lines changed

3 files changed

+1
-22
lines changed
 

‎lib/internal/bootstrap/node.js

+1-8
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
// avoid retaining a reference to the bootstrap
1818
// object.
1919
{ _setupTraceCategoryState,
20-
_setupProcessObject, _setupNextTick,
20+
_setupNextTick,
2121
_setupPromises, _chdir, _cpuUsage,
2222
_hrtime, _hrtimeBigInt,
2323
_memoryUsage, _rawDebug,
@@ -376,13 +376,6 @@
376376
const origProcProto = Object.getPrototypeOf(process);
377377
Object.setPrototypeOf(origProcProto, EventEmitter.prototype);
378378
EventEmitter.call(process);
379-
380-
_setupProcessObject(pushValueToArray);
381-
382-
function pushValueToArray() {
383-
for (var i = 0; i < arguments.length; i++)
384-
this.push(arguments[i]);
385-
}
386379
}
387380

388381
function setupGlobalVariables() {

‎src/bootstrapper.cc

-7
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,6 @@ using v8::PromiseRejectMessage;
2626
using v8::String;
2727
using v8::Value;
2828

29-
void SetupProcessObject(const FunctionCallbackInfo<Value>& args) {
30-
Environment* env = Environment::GetCurrent(args);
31-
CHECK(args[0]->IsFunction());
32-
env->set_push_values_to_array_function(args[0].As<Function>());
33-
}
34-
3529
void RunMicrotasks(const FunctionCallbackInfo<Value>& args) {
3630
args.GetIsolate()->RunMicrotasks();
3731
}
@@ -142,7 +136,6 @@ void SetupPromises(const FunctionCallbackInfo<Value>& args) {
142136
void SetupBootstrapObject(Environment* env,
143137
Local<Object> bootstrapper) {
144138
BOOTSTRAP_METHOD(_setupTraceCategoryState, SetupTraceCategoryState);
145-
BOOTSTRAP_METHOD(_setupProcessObject, SetupProcessObject);
146139
BOOTSTRAP_METHOD(_setupNextTick, SetupNextTick);
147140
BOOTSTRAP_METHOD(_setupPromises, SetupPromises);
148141
BOOTSTRAP_METHOD(_chdir, Chdir);

‎src/env.h

-7
Original file line numberDiff line numberDiff line change
@@ -82,12 +82,6 @@ struct PackageConfig {
8282
};
8383
} // namespace loader
8484

85-
// The number of items passed to push_values_to_array_function has diminishing
86-
// returns around 8. This should be used at all call sites using said function.
87-
#ifndef NODE_PUSH_VAL_TO_ARRAY_MAX
88-
#define NODE_PUSH_VAL_TO_ARRAY_MAX 8
89-
#endif
90-
9185
// PER_ISOLATE_* macros: We have a lot of per-isolate properties
9286
// and adding and maintaining their getters and setters by hand would be
9387
// difficult so let's make the preprocessor generate them for us.
@@ -350,7 +344,6 @@ struct PackageConfig {
350344
V(process_object, v8::Object) \
351345
V(promise_handler_function, v8::Function) \
352346
V(promise_wrap_template, v8::ObjectTemplate) \
353-
V(push_values_to_array_function, v8::Function) \
354347
V(sab_lifetimepartner_constructor_template, v8::FunctionTemplate) \
355348
V(script_context_constructor_template, v8::FunctionTemplate) \
356349
V(script_data_constructor_function, v8::Function) \

0 commit comments

Comments
 (0)