summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorTim Caswell <tim@creationix.com>2009-12-31 11:41:35 -0600
committerRyan Dahl <ry@tinyclouds.org>2009-12-31 09:57:29 -0800
commit732c6f2036a955e32e3f981f5681daefaeaf99a8 (patch)
tree67e1cdf5284674d755a0de1b9dc70bb0c20030e9 /test
parent642c2773a7eb2034f597af1cd404b9e086b59632 (diff)
downloadnode-732c6f2036a955e32e3f981f5681daefaeaf99a8.tar.gz
Fix inspect for the special case of an Object that inherits from Array, but has other properties.
Diffstat (limited to 'test')
-rw-r--r--test/mjsunit/test-sys.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/test/mjsunit/test-sys.js b/test/mjsunit/test-sys.js
index 1c114d8d2..893efd0e3 100644
--- a/test/mjsunit/test-sys.js
+++ b/test/mjsunit/test-sys.js
@@ -13,6 +13,7 @@ assert.equal('null', inspect(null));
assert.equal("\"\\n\\u0001\"", inspect("\n\u0001"));
assert.equal('[]', inspect([]));
+assert.equal('[]', inspect(Object.create([])));
assert.equal('[\n 1,\n 2\n]', inspect([1, 2]));
assert.equal('[\n 1,\n [\n 2,\n 3\n ]\n]', inspect([1, [2, 3]]));
@@ -23,6 +24,9 @@ assert.equal('{\n "a": 1,\n "b": 2\n}', inspect({a: 1, b: 2}));
assert.equal('{\n "a": {}\n}', inspect({'a': {}}));
assert.equal('{\n "a": {\n "b": 2\n }\n}', inspect({'a': {'b': 2}}));
-var value = {}
+var value = {};
value['a'] = value;
assert.equal('{\n "a": [Circular]\n}', inspect(value));
+value = Object.create([]);
+value.push(1);
+assert.equal('{\n "0": 1,\n "length": 1\n}', inspect(value)); \ No newline at end of file