summaryrefslogtreecommitdiff
path: root/deps/npm/node_modules/readable-stream/node_modules/inline-process-browser/node_modules/falafel/test/inspect.js
diff options
context:
space:
mode:
authorRebecca Turner <me@re-becca.org>2016-05-06 15:22:02 -0700
committerJeremiah Senkpiel <fishrock123@rocketmail.com>2016-05-10 14:45:28 -0400
commit5c36cfc8438d28ee5050ee6d5c383cf9c5b895fb (patch)
tree6165b1b2ee92982a1e157ac29c924b516771780d /deps/npm/node_modules/readable-stream/node_modules/inline-process-browser/node_modules/falafel/test/inspect.js
parent101dd1ed789175311ab22f9a32dfc480f127bc68 (diff)
downloadandroid-node-v8-5c36cfc8438d28ee5050ee6d5c383cf9c5b895fb.tar.gz
android-node-v8-5c36cfc8438d28ee5050ee6d5c383cf9c5b895fb.tar.bz2
android-node-v8-5c36cfc8438d28ee5050ee6d5c383cf9c5b895fb.zip
deps: upgrade npm to 3.8.9
Contains the following three npm releases: https://github.com/npm/npm/releases/tag/v3.8.7 https://github.com/npm/npm/releases/tag/v3.8.8 https://github.com/npm/npm/releases/tag/v3.8.9 PR-URL: https://github.com/nodejs/node/pull/6664 Reviewed-By: Myles Borins <myles.borins@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Diffstat (limited to 'deps/npm/node_modules/readable-stream/node_modules/inline-process-browser/node_modules/falafel/test/inspect.js')
-rw-r--r--deps/npm/node_modules/readable-stream/node_modules/inline-process-browser/node_modules/falafel/test/inspect.js36
1 files changed, 36 insertions, 0 deletions
diff --git a/deps/npm/node_modules/readable-stream/node_modules/inline-process-browser/node_modules/falafel/test/inspect.js b/deps/npm/node_modules/readable-stream/node_modules/inline-process-browser/node_modules/falafel/test/inspect.js
new file mode 100644
index 0000000000..c385d74f8a
--- /dev/null
+++ b/deps/npm/node_modules/readable-stream/node_modules/inline-process-browser/node_modules/falafel/test/inspect.js
@@ -0,0 +1,36 @@
+var falafel = require('../');
+var test = require('tape');
+
+test('inspect', function (t) {
+ t.plan(6);
+
+ var src = '(function () {'
+ + 'var xs = [ 1, 2, [ 3, 4 ] ];'
+ + 'var ys = [ 5, 6 ];'
+ + 'g([ xs, ys ]);'
+ + '})()';
+
+ var output = falafel(src, function (node) {
+ if (node.type === 'ArrayExpression') {
+ node.update('fn(' + node.source() + ')');
+ }
+ });
+ t.equal(output.inspect(), output.toString());
+
+ var arrays = [
+ [ 3, 4 ],
+ [ 1, 2, [ 3, 4 ] ],
+ [ 5, 6 ],
+ [ [ 1, 2, [ 3, 4 ] ], [ 5, 6 ] ],
+ ];
+
+ Function(['fn','g'], output)(
+ function (xs) {
+ t.same(arrays.shift(), xs);
+ return xs;
+ },
+ function (xs) {
+ t.same(xs, [ [ 1, 2, [ 3, 4 ] ], [ 5, 6 ] ]);
+ }
+ );
+});