Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1188)

Unified Diff: test/mjsunit/third_party/array-isarray.js

Issue 181453002: Reset trunk to 3.24.35.4 (Closed) Base URL: https://v8.googlecode.com/svn/trunk
Patch Set: Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/mjsunit/smi-mul-const.js ('k') | test/mjsunit/third_party/array-splice-webkit.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/third_party/array-isarray.js
diff --git a/test/mjsunit/third_party/object-keys.js b/test/mjsunit/third_party/array-isarray.js
similarity index 52%
copy from test/mjsunit/third_party/object-keys.js
copy to test/mjsunit/third_party/array-isarray.js
index d09265c6f738a3729bd8b75ad80a1b304408e6c9..0fc42a3f27fc060c6dc0ef7ef7cb2ac338acdb0f 100644
--- a/test/mjsunit/third_party/object-keys.js
+++ b/test/mjsunit/third_party/array-isarray.js
@@ -1,4 +1,4 @@
-// Copyright (c) 2006 Apple Computer, Inc. All rights reserved.
+// Copyright (c) 2009 Apple Computer, Inc. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
@@ -29,40 +29,20 @@
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
// OF THE POSSIBILITY OF SUCH DAMAGE.
-// Based on LayoutTests/fast/js/Object-keys.html
+// Based on LayoutTests/fast/js/resources/Array-isArray.js
-assertThrows(function () { Object.keys(2) }, TypeError);
-assertThrows(function () { Object.keys("foo") }, TypeError);
-assertThrows(function () { Object.keys(null) }, TypeError);
-assertThrows(function () { Object.keys(undefined) }, TypeError);
+assertTrue(Array.isArray([]));
+assertTrue(Array.isArray(new Array));
+assertTrue(Array.isArray(Array()));
+assertTrue(Array.isArray('abc'.match(/(a)*/g)));
+assertFalse((function(){ return Array.isArray(arguments); })());
+assertFalse(Array.isArray());
+assertFalse(Array.isArray(null));
+assertFalse(Array.isArray(undefined));
+assertFalse(Array.isArray(true));
+assertFalse(Array.isArray(false));
+assertFalse(Array.isArray('a string'));
+assertFalse(Array.isArray({}));
+assertFalse(Array.isArray({length: 5}));
+assertFalse(Array.isArray({__proto__: Array.prototype, length:1, 0:1, 1:2}));
-assertEquals(Object.keys({}), []);
-assertEquals(Object.keys({a:null}), ['a']);
-assertEquals(Object.keys({a:null, b:null}), ['a', 'b']);
-assertEquals(Object.keys({b:null, a:null}), ['b', 'a']);
-assertEquals(Object.keys([]), []);
-assertEquals(Object.keys([null]), ['0']);
-assertEquals(Object.keys([null,null]), ['0', '1']);
-assertEquals(Object.keys([null,null,,,,null]), ['0', '1', '5']);
-assertEquals(Object.keys({__proto__:{a:null}}), []);
-assertEquals(Object.keys({__proto__:[1,2,3]}), []);
-var x = [];
-x.__proto__ = [1, 2, 3];
-assertEquals(Object.keys(x), []);
-assertEquals(Object.keys(function () {}), []);
-
-assertEquals('string', typeof(Object.keys([1])[0]));
-
-function argsTest(a, b, c) {
- assertEquals(['0', '1', '2'], Object.keys(arguments));
-}
-
-argsTest(1, 2, 3);
-
-var literal = {a: 1, b: 2, c: 3};
-var keysBefore = Object.keys(literal);
-assertEquals(['a', 'b', 'c'], keysBefore);
-keysBefore[0] = 'x';
-var keysAfter = Object.keys(literal);
-assertEquals(['a', 'b', 'c'], keysAfter);
-assertEquals(['x', 'b', 'c'], keysBefore);
« no previous file with comments | « test/mjsunit/smi-mul-const.js ('k') | test/mjsunit/third_party/array-splice-webkit.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698