summaryrefslogtreecommitdiff
path: root/deps/node-inspect/tools/eslint-rules/require-buffer.js
diff options
context:
space:
mode:
authorJan Krems <jan.krems@groupon.com>2016-12-11 14:36:58 -0800
committerAnna Henningsen <anna@addaleax.net>2017-02-13 14:46:12 +0100
commit8c9762e150362c9b7f4db8e5c1680f1758f0ef9f (patch)
tree05b50a0014663acd3f1c0483eaf5d8013440c024 /deps/node-inspect/tools/eslint-rules/require-buffer.js
parentb1fc7745f2c7f279d388d8c88781df776b740259 (diff)
downloadandroid-node-v8-8c9762e150362c9b7f4db8e5c1680f1758f0ef9f.tar.gz
android-node-v8-8c9762e150362c9b7f4db8e5c1680f1758f0ef9f.tar.bz2
android-node-v8-8c9762e150362c9b7f4db8e5c1680f1758f0ef9f.zip
deps: add node-inspect 1.10.2
Squashed from: - deps: Add node-inspect 1.10.1 This adds a reimplementation of the old CLI debugger (`node debug`) against the new debugger protocol (`node --inspect`). This is necessary because the old protocol won't be supported in future versions of V8. - deps: Update node-inspect to 1.10.2 Starting with 1.10.2 the test suite should pass consistently on windows. - deps: Update to node-inspect 1.10.4 PR-URL: https://github.com/nodejs/node/pull/10187 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'deps/node-inspect/tools/eslint-rules/require-buffer.js')
-rw-r--r--deps/node-inspect/tools/eslint-rules/require-buffer.js19
1 files changed, 19 insertions, 0 deletions
diff --git a/deps/node-inspect/tools/eslint-rules/require-buffer.js b/deps/node-inspect/tools/eslint-rules/require-buffer.js
new file mode 100644
index 0000000000..c9818cb758
--- /dev/null
+++ b/deps/node-inspect/tools/eslint-rules/require-buffer.js
@@ -0,0 +1,19 @@
+'use strict';
+
+module.exports = function(context) {
+ function flagIt(reference) {
+ const msg = 'Use const Buffer = require(\'buffer\').Buffer; ' +
+ 'at the beginning of this file';
+ context.report(reference.identifier, msg);
+ }
+
+ return {
+ 'Program:exit': function() {
+ const globalScope = context.getScope();
+ const variable = globalScope.set.get('Buffer');
+ if (variable) {
+ variable.references.forEach(flagIt);
+ }
+ }
+ };
+};