Skip to content

Commit

Permalink
src: remove unused env->vm_parsing_context_symbol
Browse files Browse the repository at this point in the history
Stopped being used via 77b52fd, was
originally added in d932e80.

For the one remaining usecase inside of `lib/vm.js`, define a Symbol at
the top of the file.

PR-URL: #22034
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
  • Loading branch information
maclover7 authored and targos committed Aug 11, 2018
1 parent e1dcb79 commit 9d80199
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 13 deletions.
3 changes: 1 addition & 2 deletions lib/vm.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,15 @@

const {
ContextifyScript,
kParsingContext,
makeContext,
isContext: _isContext,
} = process.binding('contextify');

const {
ERR_INVALID_ARG_TYPE,
ERR_OUT_OF_RANGE
} = require('internal/errors').codes;
const { isUint8Array } = require('internal/util/types');
const kParsingContext = Symbol('script parsing context');

class Script extends ContextifyScript {
constructor(code, options = {}) {
Expand Down
1 change: 0 additions & 1 deletion src/env.h
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,6 @@ struct PackageConfig {
V(tls_wrap_constructor_function, v8::Function) \
V(tty_constructor_template, v8::FunctionTemplate) \
V(udp_constructor_function, v8::Function) \
V(vm_parsing_context_symbol, v8::Symbol) \
V(url_constructor_function, v8::Function) \
V(write_wrap_template, v8::ObjectTemplate)

Expand Down
10 changes: 0 additions & 10 deletions src/node_contextify.cc
Original file line number Diff line number Diff line change
Expand Up @@ -608,16 +608,6 @@ class ContextifyScript : public BaseObject {

target->Set(class_name, script_tmpl->GetFunction());
env->set_script_context_constructor_template(script_tmpl);

Local<Symbol> parsing_context_symbol =
Symbol::New(env->isolate(),
FIXED_ONE_BYTE_STRING(env->isolate(),
"script parsing context"));
env->set_vm_parsing_context_symbol(parsing_context_symbol);
target->Set(env->context(),
FIXED_ONE_BYTE_STRING(env->isolate(), "kParsingContext"),
parsing_context_symbol)
.FromJust();
}


Expand Down

0 comments on commit 9d80199

Please sign in to comment.