summaryrefslogtreecommitdiff
path: root/test/parallel/test-instanceof.js
diff options
context:
space:
mode:
authorRich Trott <rtrott@gmail.com>2017-05-03 21:07:54 -0700
committerRich Trott <rtrott@gmail.com>2017-07-03 11:39:35 -0700
commit380929ec0c4c4004b522bed5e3800ebce2b68bfd (patch)
tree6c086dfe2f734dff7a66181f81da24c450e9796a /test/parallel/test-instanceof.js
parent932ee65cd280808dd27e08fea7dfc4ebdc492b7a (diff)
downloadandroid-node-v8-380929ec0c4c4004b522bed5e3800ebce2b68bfd.tar.gz
android-node-v8-380929ec0c4c4004b522bed5e3800ebce2b68bfd.tar.bz2
android-node-v8-380929ec0c4c4004b522bed5e3800ebce2b68bfd.zip
test: remove common.noop
This change removes `common.noop` from the Node.js internal testing common module. Over the last few weeks, I've grown to dislike the `common.noop` abstraction. First, new (and experienced) contributors are unaware of it and so it results in a large number of low-value nits on PRs. It also increases the number of things newcomers and infrequent contributors have to be aware of to be effective on the project. Second, it is confusing. Is it a singleton/property or a getter? Which should be expected? This can lead to subtle and hard-to-find bugs. (To my knowledge, none have landed on master. But I also think it's only a matter of time.) Third, the abstraction is low-value in my opinion. What does it really get us? A case could me made that it is without value at all. Lastly, and this is minor, but the abstraction is wordier than not using the abstraction. `common.noop` doesn't save anything over `() => {}`. So, I propose removing it. PR-URL: https://github.com/nodejs/node/pull/12822 Reviewed-By: Teddy Katz <teddy.katz@gmail.com> Reviewed-By: Timothy Gu <timothygu99@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Refael Ackermann <refack@gmail.com>
Diffstat (limited to 'test/parallel/test-instanceof.js')
-rw-r--r--test/parallel/test-instanceof.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/test/parallel/test-instanceof.js b/test/parallel/test-instanceof.js
index c3d4ece42a..658f1e29c7 100644
--- a/test/parallel/test-instanceof.js
+++ b/test/parallel/test-instanceof.js
@@ -1,11 +1,11 @@
'use strict';
-const common = require('../common');
+require('../common');
const assert = require('assert');
// Regression test for instanceof, see
// https://github.com/nodejs/node/issues/7592
-const F = common.noop;
+const F = () => {};
F.prototype = {};
assert(Object.create(F.prototype) instanceof F);