Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGus Caplan <me@gus.host>2018-02-10 18:36:55 +0300
committerGus Caplan <me@gus.host>2018-02-10 23:50:43 +0300
commit3e8af961b384445564babfb1f0edd3cdefd19466 (patch)
tree89f05eb64e8f4e0a4d11ea52bd7a6ee162726fcf /lib/internal/test
parent01d049165c7d3ef9d102c85f0218044cb45f4787 (diff)
test: formalize exposure of internal bindings
moves exposed internalBindings to a single location with short guidelines on how to expose them and a warning for users should they come across it PR-URL: https://github.com/nodejs/node/pull/18698 Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Diffstat (limited to 'lib/internal/test')
-rw-r--r--lib/internal/test/binding.js13
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/internal/test/binding.js b/lib/internal/test/binding.js
new file mode 100644
index 00000000000..7b9e1a089d2
--- /dev/null
+++ b/lib/internal/test/binding.js
@@ -0,0 +1,13 @@
+'use strict';
+
+process.emitWarning(
+ 'These APIs are exposed only for testing and are not ' +
+ 'tracked by any versioning system or deprecation process.',
+ 'internal/test/binding');
+
+// These exports should be scoped as specifically as possible
+// to avoid exposing APIs because even with that warning and
+// this file being internal people will still try to abuse it.
+module.exports = {
+ ModuleWrap: internalBinding('module_wrap').ModuleWrap,
+};