aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorTrevor Norris <trev.norris@gmail.com>2016-04-16 03:17:54 -0600
committerTrevor Norris <trev.norris@gmail.com>2016-05-24 14:39:04 -0600
commit43b5215083287f2cfce51f50f7e12473c600eb12 (patch)
treec0843983a4b6626e200e8b93edc70785f59d6749 /test
parent9dd5b93c42a2e693a6660a580cf67723d7b287c8 (diff)
downloadandroid-node-v8-43b5215083287f2cfce51f50f7e12473c600eb12.tar.gz
android-node-v8-43b5215083287f2cfce51f50f7e12473c600eb12.tar.bz2
android-node-v8-43b5215083287f2cfce51f50f7e12473c600eb12.zip
tls_wrap: do not abort on new TLSWrap()
Though the TLSWrap constructor is only called via TLSWrap::Wrap() (i.e. tls_wrap.wrap()) internally, it is still exposed to JS. Don't allow the application to abort by inspecting the instance before it has been wrap'd by another handle. PR-URL: https://github.com/nodejs/node/pull/6184 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Anna Henningsen <anna@addaleax.net>
Diffstat (limited to 'test')
-rw-r--r--test/parallel/test-tls-wrap-no-abort.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/parallel/test-tls-wrap-no-abort.js b/test/parallel/test-tls-wrap-no-abort.js
new file mode 100644
index 0000000000..a64aea0b05
--- /dev/null
+++ b/test/parallel/test-tls-wrap-no-abort.js
@@ -0,0 +1,8 @@
+'use strict';
+
+require('../common');
+const util = require('util');
+const TLSWrap = process.binding('tls_wrap').TLSWrap;
+
+// This will abort if internal pointer is not set to nullptr.
+util.inspect(new TLSWrap());