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

Unified Diff: test/mjsunit/harmony/classes-subclass-arrays.js

Issue 976693002: Revert of Implement subclassing Arrays. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 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 | « src/x64/code-stubs-x64.cc ('k') | test/mjsunit/harmony/regress/regress-3930.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/harmony/classes-subclass-arrays.js
diff --git a/test/mjsunit/harmony/classes-subclass-arrays.js b/test/mjsunit/harmony/classes-subclass-arrays.js
deleted file mode 100644
index e0363c715bc433b7706c1aed00ab4ada0c6d10c2..0000000000000000000000000000000000000000
--- a/test/mjsunit/harmony/classes-subclass-arrays.js
+++ /dev/null
@@ -1,150 +0,0 @@
-// Copyright 2015 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-//
-// Flags: --harmony-classes
-'use strict';
-
-(function TestDefaultConstructor() {
- class Stack extends Array { }
- {
- let s1 = new Stack();
- assertSame(Stack.prototype, s1.__proto__);
- assertTrue(Array.isArray(s1));
- assertSame(0, s1.length);
- s1[0] = 'xyz';
- assertSame(1, s1.length);
- assertSame('xyz', s1[0]);
- s1.push(42);
- assertSame(2, s1.length);
- assertSame('xyz', s1[0]);
- assertSame(42, s1[1]);
- }
-
- {
- let s2 = new Stack(10);
- assertSame(Stack.prototype, s2.__proto__);
- assertTrue(Array.isArray(s2));
- assertSame(10, s2.length);
- assertSame(undefined, s2[0]);
- }
-
- {
- let a = [1,2,3];
- let s3 = new Stack(a);
- assertSame(Stack.prototype, s3.__proto__);
- assertTrue(Array.isArray(s3));
- assertSame(1, s3.length);
- assertSame(a, s3[0]);
- }
-
- {
- let s4 = new Stack(1, 2, 3);
- assertSame(Stack.prototype, s4.__proto__);
- assertTrue(Array.isArray(s4));
- assertSame(3, s4.length);
- assertSame(1, s4[0]);
- assertSame(2, s4[1]);
- assertSame(3, s4[2]);
- }
-
- {
- let s5 = new Stack(undefined, undefined, undefined);
- assertSame(Stack.prototype, s5.__proto__);
- assertTrue(Array.isArray(s5));
- assertSame(3, s5.length);
- assertSame(undefined, s5[0]);
- assertSame(undefined, s5[1]);
- assertSame(undefined, s5[2]);
- }
-}());
-
-
-(function TestEmptyArgsSuper() {
- class Stack extends Array {
- constructor() { super(); }
- }
- let s1 = new Stack();
- assertSame(Stack.prototype, s1.__proto__);
- assertTrue(Array.isArray(s1));
- assertSame(0, s1.length);
- s1[0] = 'xyz';
- assertSame(1, s1.length);
- assertSame('xyz', s1[0]);
- s1.push(42);
- assertSame(2, s1.length);
- assertSame('xyz', s1[0]);
- assertSame(42, s1[1]);
-}());
-
-
-(function TestOneArgSuper() {
- class Stack extends Array {
- constructor(x) {
- super(x);
- }
- }
-
- {
- let s2 = new Stack(10, 'ignored arg');
- assertSame(Stack.prototype, s2.__proto__);
- assertTrue(Array.isArray(s2));
- assertSame(10, s2.length);
- assertSame(undefined, s2[0]);
- }
-
- {
- let a = [1,2,3];
- let s3 = new Stack(a, 'ignored arg');
- assertSame(Stack.prototype, s3.__proto__);
- assertTrue(Array.isArray(s3));
- assertSame(1, s3.length);
- assertSame(a, s3[0]);
- }
-}());
-
-
-(function TestMultipleArgsSuper() {
- class Stack extends Array {
- constructor(x, y, z) {
- super(x, y, z);
- }
- }
- {
- let s4 = new Stack(1, 2, 3, 4, 5);
- assertSame(Stack.prototype, s4.__proto__);
- assertTrue(Array.isArray(s4));
- assertSame(3, s4.length);
- assertSame(1, s4[0]);
- assertSame(2, s4[1]);
- assertSame(3, s4[2]);
- }
-
- {
- let s5 = new Stack(undefined);
- assertSame(Stack.prototype, s5.__proto__);
- assertTrue(Array.isArray(s5));
- assertTrue(s5.__proto__ == Stack.prototype);
- assertSame(3, s5.length);
- assertSame(undefined, s5[0]);
- assertSame(undefined, s5[1]);
- assertSame(undefined, s5[2]);
- }
-}());
-
-
-(function TestArrayConcat() {
- class Stack extends Array { }
- let s1 = new Stack(1,2,3);
-
- assertArrayEquals([1,2,3,4,5,6], s1.concat([4,5,6]));
- assertArrayEquals([4,5,6,1,2,3], [4,5,6].concat(s1));
-}());
-
-
-(function TestJSONStringify() {
- class Stack extends Array { }
-
- let s1 = new Stack(1,2,3);
- assertSame("[1,2,3]", JSON.stringify(s1));
-}());
« no previous file with comments | « src/x64/code-stubs-x64.cc ('k') | test/mjsunit/harmony/regress/regress-3930.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698