Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 44fdd36

Browse filesBrowse files
addaleaxMylesBorins
authored andcommitted
src: remove SecureContext _external getter
This is unused inside Node core, so nothing good can come from keeping it around. PR-URL: #20237 Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de>
1 parent 3a3144c commit 44fdd36
Copy full SHA for 44fdd36

File tree

Expand file treeCollapse file tree

4 files changed

+1
-60
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

4 files changed

+1
-60
lines changed
Open diff view settings
Collapse file

‎src/node_crypto.cc‎

Copy file name to clipboardExpand all lines: src/node_crypto.cc
-21Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -338,19 +338,6 @@ void SecureContext::Initialize(Environment* env, Local<Object> target) {
338338
t->Set(FIXED_ONE_BYTE_STRING(env->isolate(), "kTicketKeyIVIndex"),
339339
Integer::NewFromUnsigned(env->isolate(), kTicketKeyIVIndex));
340340

341-
Local<FunctionTemplate> ctx_getter_templ =
342-
FunctionTemplate::New(env->isolate(),
343-
CtxGetter,
344-
env->as_external(),
345-
Signature::New(env->isolate(), t));
346-
347-
348-
t->PrototypeTemplate()->SetAccessorProperty(
349-
FIXED_ONE_BYTE_STRING(env->isolate(), "_external"),
350-
ctx_getter_templ,
351-
Local<FunctionTemplate>(),
352-
static_cast<PropertyAttribute>(ReadOnly | DontDelete));
353-
354341
target->Set(secureContextString, t->GetFunction());
355342
env->set_secure_context_constructor_template(t);
356343
}
@@ -1350,14 +1337,6 @@ int SecureContext::TicketCompatibilityCallback(SSL* ssl,
13501337
}
13511338

13521339

1353-
void SecureContext::CtxGetter(const FunctionCallbackInfo<Value>& info) {
1354-
SecureContext* sc;
1355-
ASSIGN_OR_RETURN_UNWRAP(&sc, info.This());
1356-
Local<External> ext = External::New(info.GetIsolate(), sc->ctx_);
1357-
info.GetReturnValue().Set(ext);
1358-
}
1359-
1360-
13611340
template <bool primary>
13621341
void SecureContext::GetCertificate(const FunctionCallbackInfo<Value>& args) {
13631342
SecureContext* wrap;
Collapse file

‎src/node_crypto.h‎

Copy file name to clipboardExpand all lines: src/node_crypto.h
-1Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,6 @@ class SecureContext : public BaseObject {
148148
const v8::FunctionCallbackInfo<v8::Value>& args);
149149
static void EnableTicketKeyCallback(
150150
const v8::FunctionCallbackInfo<v8::Value>& args);
151-
static void CtxGetter(const v8::FunctionCallbackInfo<v8::Value>& info);
152151

153152
template <bool primary>
154153
static void GetCertificate(const v8::FunctionCallbackInfo<v8::Value>& args);
Collapse file

‎test/parallel/test-accessor-properties.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-accessor-properties.js
+1-16Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict';
22

3-
const common = require('../common');
3+
require('../common');
44

55
// This tests that the accessor properties do not raise assertions
66
// when called with incompatible receivers.
@@ -50,19 +50,4 @@ const UDP = process.binding('udp_wrap').UDP;
5050
typeof Object.getOwnPropertyDescriptor(UDP.prototype, 'fd'),
5151
'object'
5252
);
53-
54-
if (common.hasCrypto) { // eslint-disable-line node-core/crypto-check
55-
// There are accessor properties in crypto too
56-
const crypto = process.binding('crypto');
57-
58-
assert.throws(() => {
59-
crypto.SecureContext.prototype._external;
60-
}, TypeError);
61-
62-
assert.strictEqual(
63-
typeof Object.getOwnPropertyDescriptor(
64-
crypto.SecureContext.prototype, '_external'),
65-
'object'
66-
);
67-
}
6853
}
Collapse file

‎test/parallel/test-tls-external-accessor.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-tls-external-accessor.js
-22Lines changed: 0 additions & 22 deletions
This file was deleted.

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.