mirror of
https://github.com/dart-lang/sdk
synced 2024-09-18 21:51:18 +00:00
f36b8aa4e4
This bug was only happening for the --fast-startup. For most browsers we simply change the '__proto__' and the order wouldn't be important. However, for the other browsers we have to do it in order. R=sigmund@google.com Review URL: https://codereview.chromium.org//1347423003 .
103 lines
2.2 KiB
Dart
103 lines
2.2 KiB
Dart
// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
|
|
// for details. All rights reserved. Use of this source code is governed by a
|
|
// BSD-style license that can be found in the LICENSE file.
|
|
|
|
import "package:expect/expect.dart";
|
|
import "inheritance_chain_lib.dart";
|
|
|
|
class A extends B {
|
|
get id => "A";
|
|
get length => 1;
|
|
}
|
|
|
|
class C extends D {
|
|
get id => "C";
|
|
get length => 3;
|
|
}
|
|
|
|
class X extends W {
|
|
get id => "X";
|
|
get length => -3;
|
|
}
|
|
|
|
class Z extends Y {
|
|
get id => "Z";
|
|
get length => -1;
|
|
}
|
|
|
|
main() {
|
|
var instances = [
|
|
new A(),
|
|
new B(),
|
|
new C(),
|
|
new D(),
|
|
new W(),
|
|
new X(),
|
|
new Y(),
|
|
new Z(),
|
|
[],
|
|
];
|
|
|
|
var o = instances[0];
|
|
Expect.equals("A", o.id);
|
|
Expect.equals(1, o.length);
|
|
Expect.isTrue(o is A);
|
|
Expect.isTrue(o is B);
|
|
Expect.isTrue(o is C);
|
|
Expect.isTrue(o is D);
|
|
Expect.isTrue(o is W);
|
|
Expect.isTrue(o is X);
|
|
Expect.isTrue(o is Y);
|
|
Expect.isTrue(o is Z);
|
|
o = instances[1];
|
|
Expect.equals("B", o.id);
|
|
Expect.equals(2, o.length);
|
|
Expect.isTrue(o is B);
|
|
Expect.isTrue(o is C);
|
|
Expect.isTrue(o is D);
|
|
Expect.isTrue(o is W);
|
|
Expect.isTrue(o is X);
|
|
Expect.isTrue(o is Y);
|
|
Expect.isTrue(o is Z);
|
|
o = instances[2];
|
|
Expect.equals("C", o.id);
|
|
Expect.equals(3, o.length);
|
|
Expect.isTrue(o is C);
|
|
Expect.isTrue(o is D);
|
|
Expect.isTrue(o is W);
|
|
Expect.isTrue(o is X);
|
|
Expect.isTrue(o is Y);
|
|
Expect.isTrue(o is Z);
|
|
o = instances[3];
|
|
Expect.equals("D", o.id);
|
|
Expect.equals(4, o.length);
|
|
Expect.isTrue(o is D);
|
|
Expect.isTrue(o is W);
|
|
Expect.isTrue(o is X);
|
|
Expect.isTrue(o is Y);
|
|
Expect.isTrue(o is Z);
|
|
o = instances[4];
|
|
Expect.equals("W", o.id);
|
|
Expect.equals(-4, o.length);
|
|
Expect.isTrue(o is W);
|
|
o = instances[5];
|
|
Expect.equals("X", o.id);
|
|
Expect.equals(-3, o.length);
|
|
Expect.isTrue(o is X);
|
|
Expect.isTrue(o is W);
|
|
o = instances[6];
|
|
Expect.equals("Y", o.id);
|
|
Expect.equals(-2, o.length);
|
|
Expect.isTrue(o is Y);
|
|
Expect.isTrue(o is X);
|
|
Expect.isTrue(o is W);
|
|
o = instances[7];
|
|
Expect.equals("Z", o.id);
|
|
Expect.equals(-1, o.length);
|
|
Expect.isTrue(o is Z);
|
|
Expect.isTrue(o is Y);
|
|
Expect.isTrue(o is X);
|
|
Expect.isTrue(o is W);
|
|
o = instances[8];
|
|
Expect.equals(0, o.length);
|
|
} |