mirror of
https://github.com/dart-lang/sdk
synced 2024-11-02 08:44:27 +00:00
Format all tests.
There are far too many files here to review everyone carefully. Spot checking most of the diffs look good as test code is generally written with less care than application code so lots of ugly formatting get through. If people notice files where the automated formatting bothers them feel free to comment indicating file names and I'll move spaces within comments to make the formatting cleaner and use comments to force block formatting as I have done for other case where formatting looked bad. BUG= R=efortuna@google.com Review-Url: https://codereview.chromium.org/2771453003 .
This commit is contained in:
parent
0adb817be2
commit
2dcd56ef43
4129 changed files with 288489 additions and 61440 deletions
|
@ -3,6 +3,7 @@
|
|||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
library sample_test;
|
||||
|
||||
import 'package:unittest/unittest.dart';
|
||||
import 'package:unittest/html_config.dart';
|
||||
import 'dart:_chrome' as _chrome;
|
||||
|
|
|
@ -30,7 +30,7 @@ class BenchmarkBase {
|
|||
* The benchmark code.
|
||||
* This function is not used, if both [warmup] and [exercise] are overwritten.
|
||||
*/
|
||||
void run() { }
|
||||
void run() {}
|
||||
|
||||
/** Runs a short version of the benchmark. By default invokes [run] once. */
|
||||
void warmup() {
|
||||
|
@ -45,10 +45,10 @@ class BenchmarkBase {
|
|||
}
|
||||
|
||||
/** Not measured setup code executed prior to the benchmark runs. */
|
||||
void setup() { }
|
||||
void setup() {}
|
||||
|
||||
/** Not measures teardown code executed after the benchark runs. */
|
||||
void teardown() { }
|
||||
void teardown() {}
|
||||
|
||||
/**
|
||||
* Measures the score for this benchmark by executing it repeately until
|
||||
|
@ -75,9 +75,13 @@ class BenchmarkBase {
|
|||
double measure() {
|
||||
setup();
|
||||
// Warmup for at least 1000ms. Discard result.
|
||||
measureFor(() { this.warmup(); }, 1000);
|
||||
measureFor(() {
|
||||
this.warmup();
|
||||
}, 1000);
|
||||
// Run the benchmark for at least 1000ms.
|
||||
double result = measureFor(() { this.exercise(); }, 1000);
|
||||
double result = measureFor(() {
|
||||
this.exercise();
|
||||
}, 1000);
|
||||
teardown();
|
||||
return result;
|
||||
}
|
||||
|
@ -118,7 +122,7 @@ class BenchmarkSuite {
|
|||
runBenchmarksHelper(benchmarks);
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Run the remaining benchmarks in our list. We chain the calls providing
|
||||
* little breaks for the main page to gain control, so we don't force the
|
||||
* entire page to hang the whole time.
|
||||
|
@ -157,7 +161,6 @@ class BenchmarkSuite {
|
|||
|
||||
/** Controls how results are displayed to the user, by updating the HTML. */
|
||||
class BenchmarkView {
|
||||
|
||||
/** The number of benchmarks that have finished executing. */
|
||||
int numCompleted = 0;
|
||||
|
||||
|
@ -170,8 +173,8 @@ class BenchmarkView {
|
|||
setScore(num score) {
|
||||
String newScore = formatScore(score * 100.0);
|
||||
Element body = document.queryAll("body")[0];
|
||||
body.nodes.add(
|
||||
new Element.html("<p id='testResultScore'>Score: $newScore</p>"));
|
||||
body.nodes
|
||||
.add(new Element.html("<p id='testResultScore'>Score: $newScore</p>"));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -10,4 +10,3 @@ import 'dart:math' as Math;
|
|||
|
||||
import 'smoketest_lib.dart';
|
||||
part 'benchmark_base.dart';
|
||||
|
||||
|
|
|
@ -12,7 +12,6 @@ import 'dart:html';
|
|||
* broken Firefox.
|
||||
*/
|
||||
class Smoketest extends BenchmarkBase {
|
||||
|
||||
const Smoketest() : super("Smoketest");
|
||||
|
||||
void run() {}
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load diff
File diff suppressed because one or more lines are too long
|
@ -10,7 +10,9 @@ import 'package:expect/expect.dart';
|
|||
abstract class A {
|
||||
set x(v) {}
|
||||
set z(v) {}
|
||||
set y(v) { return 'hi';}
|
||||
set y(v) {
|
||||
return 'hi';
|
||||
}
|
||||
}
|
||||
|
||||
class S extends A {
|
||||
|
|
|
@ -56,7 +56,7 @@ const int PI5 = 0x123456789AB;
|
|||
const int PI6 = 0x123456789ABCDEF;
|
||||
const int PI7 = 0x123456789ABCDEF0123456789ABCDEF0123456789ABCDEF;
|
||||
|
||||
const int NI1 = 0-PI1;
|
||||
const int NI1 = 0 - PI1;
|
||||
const int NI2 = -PI2;
|
||||
const int NI3 = -PI3;
|
||||
const int NI4 = -PI4;
|
||||
|
@ -64,9 +64,8 @@ const int NI5 = -PI5;
|
|||
const int NI6 = -PI6;
|
||||
const int NI7 = -PI7;
|
||||
|
||||
|
||||
/// Ensures that the behaviour of `action()` is the same as `value.round()`.
|
||||
@NoInline() // To ensure 'value.round()' has a non-constant receiver.
|
||||
@NoInline() // To ensure 'value.round()' has a non-constant receiver.
|
||||
check(value, action) {
|
||||
var result1, result2;
|
||||
try {
|
||||
|
@ -157,11 +156,23 @@ main() {
|
|||
|
||||
// Check that the operation is not removed if it can throw, even if the result
|
||||
// is unused.
|
||||
Expect.throws(() { X1.round(); });
|
||||
Expect.throws(() { X2.round(); });
|
||||
Expect.throws(() { X3.round(); });
|
||||
Expect.throws(() {
|
||||
X1.round();
|
||||
});
|
||||
Expect.throws(() {
|
||||
X2.round();
|
||||
});
|
||||
Expect.throws(() {
|
||||
X3.round();
|
||||
});
|
||||
unusedCall(0);
|
||||
Expect.throws(() { unusedCall(X1); });
|
||||
Expect.throws(() { unusedCall(X2); });
|
||||
Expect.throws(() { unusedCall(X3); });
|
||||
Expect.throws(() {
|
||||
unusedCall(X1);
|
||||
});
|
||||
Expect.throws(() {
|
||||
unusedCall(X2);
|
||||
});
|
||||
Expect.throws(() {
|
||||
unusedCall(X3);
|
||||
});
|
||||
}
|
||||
|
|
|
@ -62,7 +62,7 @@ var x = 0;
|
|||
|
||||
@NoInline()
|
||||
switcher3(val) {
|
||||
switch(val) {
|
||||
switch (val) {
|
||||
case 1:
|
||||
default:
|
||||
incrementX();
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
// 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.
|
||||
|
||||
|
||||
/// Tests that dart2js allows to import dart:io for web clients, but it
|
||||
/// continues to indicate that it is not supported (so config-specific imports
|
||||
/// continue to have the same semantics as before).
|
||||
|
|
|
@ -13,13 +13,13 @@ abstract class A {}
|
|||
|
||||
@Native("B")
|
||||
abstract class B {
|
||||
foo() native ;
|
||||
foo() native;
|
||||
}
|
||||
|
||||
class C {}
|
||||
|
||||
makeA() native ;
|
||||
makeB() native ;
|
||||
makeA() native;
|
||||
makeB() native;
|
||||
|
||||
void setup() native """
|
||||
// This code is all inside 'setup' and so not accesible from the global scope.
|
||||
|
|
|
@ -13,19 +13,19 @@ class AA {
|
|||
|
||||
@Native("BB")
|
||||
class BB {
|
||||
foo(a, [b = 'B']) native ;
|
||||
foo(a, [b = 'B']) native;
|
||||
}
|
||||
|
||||
@Native("CC")
|
||||
class CC extends BB {
|
||||
foo(a, [b = 'C']) native ;
|
||||
foo(a, [b = 'C']) native;
|
||||
|
||||
get superfoo => super.foo;
|
||||
}
|
||||
|
||||
makeBB() native ;
|
||||
makeCC() native ;
|
||||
inscrutable(a) native ;
|
||||
makeBB() native;
|
||||
makeCC() native;
|
||||
inscrutable(a) native;
|
||||
|
||||
void setup() native r"""
|
||||
function BB() {}
|
||||
|
|
|
@ -15,11 +15,11 @@ class T1B {}
|
|||
@Native("T1C")
|
||||
class T1C {}
|
||||
|
||||
makeT1A() native ;
|
||||
makeT1B() native ;
|
||||
makeT1C() native ;
|
||||
makeT1A() native;
|
||||
makeT1B() native;
|
||||
makeT1C() native;
|
||||
|
||||
int getTagCallCount() native ;
|
||||
int getTagCallCount() native;
|
||||
|
||||
void setup() native r'''
|
||||
function T1A() { } // Normal native class.
|
||||
|
|
|
@ -16,11 +16,11 @@ class T1B {}
|
|||
@Native("T1C")
|
||||
class T1C {}
|
||||
|
||||
makeT1A() native ;
|
||||
makeT1B() native ;
|
||||
makeT1C() native ;
|
||||
makeT1A() native;
|
||||
makeT1B() native;
|
||||
makeT1C() native;
|
||||
|
||||
int getTagCallCount() native ;
|
||||
int getTagCallCount() native;
|
||||
|
||||
void setup() native r'''
|
||||
function T1A() { } // Normal native class.
|
||||
|
|
|
@ -10,31 +10,31 @@ import "native_testing.dart";
|
|||
|
||||
@Native("T1A")
|
||||
class T1A {
|
||||
foo() native ;
|
||||
foo() native;
|
||||
}
|
||||
|
||||
@Native("T1B")
|
||||
class T1B {
|
||||
foo() native ;
|
||||
foo() native;
|
||||
}
|
||||
|
||||
@Native("T1C")
|
||||
class T1C {
|
||||
foo() native ;
|
||||
foo() native;
|
||||
}
|
||||
|
||||
@Native("T1D")
|
||||
class T1D {
|
||||
foo() native ;
|
||||
foo() native;
|
||||
}
|
||||
|
||||
makeT1A() native ;
|
||||
makeT1B() native ;
|
||||
makeT1C() native ;
|
||||
makeT1D() native ;
|
||||
makeT1A() native;
|
||||
makeT1B() native;
|
||||
makeT1C() native;
|
||||
makeT1D() native;
|
||||
|
||||
int getTagCallCount() native ;
|
||||
void clearTagCallCount() native ;
|
||||
int getTagCallCount() native;
|
||||
void clearTagCallCount() native;
|
||||
|
||||
void setup() native r'''
|
||||
function T1A() { this.v = "a"; }
|
||||
|
|
|
@ -16,10 +16,10 @@ class C implements Pattern {}
|
|||
@Native("D")
|
||||
class D implements Pattern, Comparable {}
|
||||
|
||||
makeA() native ;
|
||||
makeB() native ;
|
||||
makeC() native ;
|
||||
makeD() native ;
|
||||
makeA() native;
|
||||
makeB() native;
|
||||
makeC() native;
|
||||
makeD() native;
|
||||
|
||||
void setup() native """
|
||||
function A() {};
|
||||
|
|
|
@ -22,7 +22,6 @@ self.makeFoo = function() { return new Foo(); }
|
|||
self.nativeConstructor(Foo);
|
||||
""";
|
||||
|
||||
|
||||
main() {
|
||||
nativeTesting();
|
||||
setup();
|
||||
|
|
|
@ -18,15 +18,15 @@ abstract class I extends J {
|
|||
@Native("A")
|
||||
class A implements I {
|
||||
// The native class accepts only other native instances.
|
||||
A read() native ;
|
||||
write(A x) native ;
|
||||
A read() native;
|
||||
write(A x) native;
|
||||
}
|
||||
|
||||
@Native("B")
|
||||
class B extends A {}
|
||||
|
||||
makeA() native ;
|
||||
makeB() native ;
|
||||
makeA() native;
|
||||
makeB() native;
|
||||
|
||||
void setup() native """
|
||||
// This code is all inside 'setup' and so not accesible from the global scope.
|
||||
|
|
|
@ -24,14 +24,14 @@ class Rascal {
|
|||
toString() => 'RRRRRRRR';
|
||||
}
|
||||
|
||||
makeA() native ;
|
||||
makeB() native ;
|
||||
makeC() native ;
|
||||
makeD() native ;
|
||||
makeE() native ;
|
||||
makeP() native ;
|
||||
makeQ() native ;
|
||||
makeR() native ;
|
||||
makeA() native;
|
||||
makeB() native;
|
||||
makeC() native;
|
||||
makeD() native;
|
||||
makeE() native;
|
||||
makeP() native;
|
||||
makeQ() native;
|
||||
makeR() native;
|
||||
|
||||
void setup() native r"""
|
||||
makeA = function(){return {hello: 123};};
|
||||
|
|
|
@ -10,10 +10,10 @@ typedef void Callback0();
|
|||
|
||||
@Native("A")
|
||||
class A {
|
||||
foo(Callback0 f) native ;
|
||||
foo(Callback0 f) native;
|
||||
}
|
||||
|
||||
makeA() native ;
|
||||
makeA() native;
|
||||
|
||||
void setup() native r"""
|
||||
function A() {}
|
||||
|
|
|
@ -14,9 +14,9 @@ class Thing {}
|
|||
@Native("NT")
|
||||
class NativeThing {}
|
||||
|
||||
make1() native ;
|
||||
make2() native ;
|
||||
make3() native ;
|
||||
make1() native;
|
||||
make2() native;
|
||||
make3() native;
|
||||
|
||||
void setup() native r"""
|
||||
function A() {}
|
||||
|
|
|
@ -12,8 +12,8 @@ import "package:expect/expect.dart";
|
|||
|
||||
class Thing {}
|
||||
|
||||
make1() native ;
|
||||
make2() native ;
|
||||
make1() native;
|
||||
make2() native;
|
||||
|
||||
void setup() native r"""
|
||||
function A() {}
|
||||
|
|
|
@ -12,7 +12,7 @@ class Node {
|
|||
final parentNode;
|
||||
}
|
||||
|
||||
makeNode(parent) native ;
|
||||
makeNode(parent) native;
|
||||
|
||||
void setup() native """
|
||||
// This code is all inside 'setup' and so not accesible from the global scope.
|
||||
|
|
|
@ -35,7 +35,7 @@ class Node {
|
|||
}
|
||||
}
|
||||
|
||||
makeNode(parent) native ;
|
||||
makeNode(parent) native;
|
||||
|
||||
class ModelSource {
|
||||
var name;
|
||||
|
|
|
@ -9,7 +9,7 @@ import "native_testing.dart";
|
|||
@Native("A")
|
||||
class Foo {
|
||||
// There is one native class with dispatch tag 'A'.
|
||||
token() native ;
|
||||
token() native;
|
||||
}
|
||||
|
||||
void setup() native r"""
|
||||
|
@ -37,8 +37,8 @@ makeB = function() { return new B; };
|
|||
self.nativeConstructor(A);
|
||||
""";
|
||||
|
||||
makeA() native ;
|
||||
makeB() native ;
|
||||
makeA() native;
|
||||
makeB() native;
|
||||
|
||||
main() {
|
||||
nativeTesting();
|
||||
|
|
|
@ -21,8 +21,8 @@ foreign2() {
|
|||
}
|
||||
|
||||
foreign11(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11) {
|
||||
return JS("num|String", r"# + # + # + # + # + # + # + # + # + # + #",
|
||||
a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11);
|
||||
return JS("num|String", r"# + # + # + # + # + # + # + # + # + # + #", a1, a2,
|
||||
a3, a4, a5, a6, a7, a8, a9, a10, a11);
|
||||
}
|
||||
|
||||
void main() {
|
||||
|
|
|
@ -12,8 +12,8 @@ class B {
|
|||
int get hashCode => 1234567;
|
||||
}
|
||||
|
||||
makeA() native ;
|
||||
makeB() native ;
|
||||
makeA() native;
|
||||
makeB() native;
|
||||
|
||||
void setup() native """
|
||||
function A() {}
|
||||
|
|
|
@ -30,7 +30,7 @@ makeA = function() { return new A; };
|
|||
self.nativeConstructor(A);
|
||||
""";
|
||||
|
||||
makeA() native ;
|
||||
makeA() native;
|
||||
|
||||
main() {
|
||||
nativeTesting();
|
||||
|
|
|
@ -20,9 +20,9 @@ import 'dart:_interceptors'
|
|||
@Native('QQ')
|
||||
class Q {}
|
||||
|
||||
makeA() native ;
|
||||
makeB() native ;
|
||||
makeQ() native ;
|
||||
makeA() native;
|
||||
makeB() native;
|
||||
makeQ() native;
|
||||
|
||||
void setup() native r"""
|
||||
makeA = function(){return {hello: 123};};
|
||||
|
|
|
@ -13,7 +13,10 @@ class B extends A {
|
|||
}
|
||||
|
||||
@NoInline()
|
||||
escape(v) { g = v; }
|
||||
escape(v) {
|
||||
g = v;
|
||||
}
|
||||
|
||||
var g;
|
||||
|
||||
main() {
|
||||
|
@ -22,7 +25,7 @@ main() {
|
|||
|
||||
a.a = 1;
|
||||
if (a is B) {
|
||||
escape(a); // Here we need to escape 'a' not the refinement of a to B.
|
||||
escape(a); // Here we need to escape 'a' not the refinement of a to B.
|
||||
g.a = 2;
|
||||
Expect.equals(2, a.a);
|
||||
}
|
||||
|
|
|
@ -14,19 +14,19 @@ import "native_testing.dart";
|
|||
|
||||
@Native("A")
|
||||
class A {
|
||||
int foo(int x) native ;
|
||||
int foo(int x) native;
|
||||
}
|
||||
|
||||
@Native("B")
|
||||
class B {
|
||||
int foo([x, y, z]) native ;
|
||||
int foo([x, y, z]) native;
|
||||
}
|
||||
|
||||
// TODO(sra): Add a case where the parameters have default values. Wait until
|
||||
// dart:html need non-null default values.
|
||||
|
||||
A makeA() native ;
|
||||
B makeB() native ;
|
||||
A makeA() native;
|
||||
B makeB() native;
|
||||
|
||||
void setup() native """
|
||||
function A() {}
|
||||
|
|
|
@ -9,16 +9,16 @@ import "native_testing.dart";
|
|||
|
||||
@Native("A")
|
||||
class A {
|
||||
int foo([x, y]) native ;
|
||||
int foo([x, y]) native;
|
||||
}
|
||||
|
||||
@Native("B")
|
||||
class B extends A {
|
||||
int foo([x, y]) native ;
|
||||
int foo([x, y]) native;
|
||||
}
|
||||
|
||||
makeA() native ;
|
||||
makeB() native ;
|
||||
makeA() native;
|
||||
makeB() native;
|
||||
|
||||
void setup() native """
|
||||
function inherits(child, parent) {
|
||||
|
|
|
@ -10,19 +10,19 @@ import "native_testing.dart";
|
|||
|
||||
@Native("A")
|
||||
class A {
|
||||
int foo(int x) native ;
|
||||
int foo(int x) native;
|
||||
}
|
||||
|
||||
@Native("B")
|
||||
class B {
|
||||
int foo([x = null, y, z = null]) native ;
|
||||
int foo([x = null, y, z = null]) native;
|
||||
}
|
||||
|
||||
// TODO(sra): Add a case where the parameters have default values. Wait until
|
||||
// dart:html need non-null default values.
|
||||
|
||||
A makeA() native ;
|
||||
B makeB() native ;
|
||||
A makeA() native;
|
||||
B makeB() native;
|
||||
|
||||
void setup() native """
|
||||
function A() {}
|
||||
|
|
|
@ -8,18 +8,18 @@ import 'native_testing.dart';
|
|||
|
||||
@Native("A")
|
||||
class A {
|
||||
int foo(int x) native ;
|
||||
int cmp(A other) native ;
|
||||
int foo(int x) native;
|
||||
int cmp(A other) native;
|
||||
}
|
||||
|
||||
@Native("B")
|
||||
class B {
|
||||
String foo(String x) native ;
|
||||
int cmp(B other) native ;
|
||||
String foo(String x) native;
|
||||
int cmp(B other) native;
|
||||
}
|
||||
|
||||
A makeA() native ;
|
||||
B makeB() native ;
|
||||
A makeA() native;
|
||||
B makeB() native;
|
||||
|
||||
void setup() native """
|
||||
function A() {}
|
||||
|
|
|
@ -16,8 +16,8 @@ class B {
|
|||
String foo;
|
||||
}
|
||||
|
||||
A makeA() native ;
|
||||
B makeB() native ;
|
||||
A makeA() native;
|
||||
B makeB() native;
|
||||
|
||||
void setup() native """
|
||||
function A() {}
|
||||
|
|
|
@ -24,8 +24,8 @@ class CC {
|
|||
static CC create() => new CC();
|
||||
}
|
||||
|
||||
makeA() native ;
|
||||
makeB() native ;
|
||||
makeA() native;
|
||||
makeB() native;
|
||||
|
||||
void setup1() native """
|
||||
// Poison hidden native names 'BB' and 'CC' to prove the compiler didn't place
|
||||
|
|
|
@ -35,7 +35,7 @@ makeA = function() { return new A; };
|
|||
self.nativeConstructor(A);
|
||||
""";
|
||||
|
||||
A makeA() native ;
|
||||
A makeA() native;
|
||||
|
||||
class B {
|
||||
void a() {}
|
||||
|
|
|
@ -61,7 +61,7 @@ makeA = function() { return new A; };
|
|||
self.nativeConstructor(A);
|
||||
""";
|
||||
|
||||
A makeA() native ;
|
||||
A makeA() native;
|
||||
|
||||
class B {}
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@ makeA = function(){return new A;};
|
|||
self.nativeConstructor(A);
|
||||
""";
|
||||
|
||||
A makeA() native ;
|
||||
A makeA() native;
|
||||
|
||||
main() {
|
||||
nativeTesting();
|
||||
|
|
|
@ -12,30 +12,30 @@ import "native_testing.dart";
|
|||
// Version 1: It might be possible to call foo directly.
|
||||
@Native("A1")
|
||||
class A1 {
|
||||
foo() native ;
|
||||
foo() native;
|
||||
}
|
||||
|
||||
@Native("B1")
|
||||
class B1 extends A1 {
|
||||
foo() native ;
|
||||
foo() native;
|
||||
}
|
||||
|
||||
makeA1() native ;
|
||||
makeB1() native ;
|
||||
makeA1() native;
|
||||
makeB1() native;
|
||||
|
||||
// Version 2: foo needs some kind of trampoline.
|
||||
@Native("A2")
|
||||
class A2 {
|
||||
foo([a = 99]) native ;
|
||||
foo([a = 99]) native;
|
||||
}
|
||||
|
||||
@Native("B2")
|
||||
class B2 extends A2 {
|
||||
foo([z = 1000]) native ;
|
||||
foo([z = 1000]) native;
|
||||
}
|
||||
|
||||
makeA2() native ;
|
||||
makeB2() native ;
|
||||
makeA2() native;
|
||||
makeB2() native;
|
||||
|
||||
void setup() native """
|
||||
// This code is all inside 'setup' and so not accesible from the global scope.
|
||||
|
|
|
@ -11,7 +11,7 @@ import "native_testing.dart";
|
|||
|
||||
@Native("A")
|
||||
class A {
|
||||
foo([a = 100]) native ;
|
||||
foo([a = 100]) native;
|
||||
}
|
||||
|
||||
@Native("B")
|
||||
|
@ -19,16 +19,16 @@ class B extends A {}
|
|||
|
||||
@Native("C")
|
||||
class C extends B {
|
||||
foo([z = 300]) native ;
|
||||
foo([z = 300]) native;
|
||||
}
|
||||
|
||||
@Native("D")
|
||||
class D extends C {}
|
||||
|
||||
makeA() native ;
|
||||
makeB() native ;
|
||||
makeC() native ;
|
||||
makeD() native ;
|
||||
makeA() native;
|
||||
makeB() native;
|
||||
makeC() native;
|
||||
makeD() native;
|
||||
|
||||
void setup() native """
|
||||
// This code is all inside 'setup' and so not accesible from the global scope.
|
||||
|
|
|
@ -14,21 +14,21 @@ class A1 {}
|
|||
@Native("B1")
|
||||
class B1 extends A1 {}
|
||||
|
||||
makeA1() native ;
|
||||
makeB1() native ;
|
||||
makeA1() native;
|
||||
makeB1() native;
|
||||
|
||||
@Native("A2")
|
||||
class A2 {
|
||||
foo([a = 99]) native ;
|
||||
foo([a = 99]) native;
|
||||
}
|
||||
|
||||
@Native("B2")
|
||||
class B2 extends A2 {}
|
||||
|
||||
makeA2() native ;
|
||||
makeB2() native ;
|
||||
makeA2() native;
|
||||
makeB2() native;
|
||||
|
||||
makeObject() native ;
|
||||
makeObject() native;
|
||||
|
||||
void setup() native """
|
||||
// This code is all inside 'setup' and so not accesible from the global scope.
|
||||
|
|
|
@ -32,8 +32,8 @@ class B extends A {
|
|||
int method(int z) => _field2 + z;
|
||||
}
|
||||
|
||||
A makeA() native ;
|
||||
B makeB() native ;
|
||||
A makeA() native;
|
||||
B makeB() native;
|
||||
|
||||
void setup() native r"""
|
||||
function inherits(child, parent) {
|
||||
|
|
|
@ -16,11 +16,11 @@ abstract class I {
|
|||
@Native("A")
|
||||
class A implements I {
|
||||
// The native class accepts only other native instances.
|
||||
A read() native ;
|
||||
write(A x) native ;
|
||||
A read() native;
|
||||
write(A x) native;
|
||||
}
|
||||
|
||||
makeA() native ;
|
||||
makeA() native;
|
||||
|
||||
void setup() native """
|
||||
// This code is all inside 'setup' and so not accesible from the global scope.
|
||||
|
|
|
@ -18,15 +18,15 @@ abstract class I extends J {
|
|||
@Native("A")
|
||||
class A implements I {
|
||||
// The native class accepts only other native instances.
|
||||
A read() native ;
|
||||
write(A x) native ;
|
||||
A read() native;
|
||||
write(A x) native;
|
||||
}
|
||||
|
||||
@Native("B")
|
||||
class B extends A {}
|
||||
|
||||
makeA() native ;
|
||||
makeB() native ;
|
||||
makeA() native;
|
||||
makeB() native;
|
||||
|
||||
void setup() native """
|
||||
// This code is all inside 'setup' and so not accesible from the global scope.
|
||||
|
|
|
@ -18,7 +18,7 @@ class A {
|
|||
int method(int z) => _field + z;
|
||||
}
|
||||
|
||||
A makeA() native ;
|
||||
A makeA() native;
|
||||
|
||||
void setup() native """
|
||||
function A() {}
|
||||
|
|
|
@ -8,12 +8,12 @@ typedef void MyFunctionType();
|
|||
|
||||
@Native("A")
|
||||
class A {
|
||||
setClosure(MyFunctionType f) native ;
|
||||
check(MyFunctionType f) native ;
|
||||
invoke() native ;
|
||||
setClosure(MyFunctionType f) native;
|
||||
check(MyFunctionType f) native;
|
||||
invoke() native;
|
||||
}
|
||||
|
||||
makeA() native ;
|
||||
makeA() native;
|
||||
|
||||
void setup() native """
|
||||
function A() {}
|
||||
|
|
|
@ -17,7 +17,7 @@ class Z {
|
|||
foo() => 100;
|
||||
}
|
||||
|
||||
makeZ() native ;
|
||||
makeZ() native;
|
||||
|
||||
void setup() native """
|
||||
function A(){}
|
||||
|
|
|
@ -8,17 +8,19 @@ import 'native_testing.dart';
|
|||
class A {}
|
||||
|
||||
int calls = 0;
|
||||
|
||||
@Native("B")
|
||||
class B {
|
||||
bool operator==(other) {
|
||||
bool operator ==(other) {
|
||||
++calls;
|
||||
return other is B;
|
||||
}
|
||||
|
||||
int get hashCode => 1;
|
||||
}
|
||||
|
||||
makeA() native ;
|
||||
makeB() native ;
|
||||
makeA() native;
|
||||
makeB() native;
|
||||
|
||||
void setup() native """
|
||||
function A() {}
|
||||
|
|
|
@ -15,7 +15,7 @@ class NativeClass {
|
|||
foo() => 'oof';
|
||||
}
|
||||
|
||||
makeNativeClass() native ;
|
||||
makeNativeClass() native;
|
||||
|
||||
setup() native """
|
||||
function NativeClass() {}
|
||||
|
|
|
@ -18,7 +18,7 @@ import 'native_testing.dart';
|
|||
// The exception type.
|
||||
@Native("E")
|
||||
class E {
|
||||
E._used() native ; // Bogus native constructor, called only from fake body.
|
||||
E._used() native; // Bogus native constructor, called only from fake body.
|
||||
|
||||
final int code;
|
||||
}
|
||||
|
@ -29,7 +29,7 @@ class A {
|
|||
// Exception class E is created.
|
||||
@Creates("E")
|
||||
@Returns('int')
|
||||
op(int x) native ;
|
||||
op(int x) native;
|
||||
}
|
||||
|
||||
// This class is here just so that a dynamic context is polymorphic.
|
||||
|
@ -38,7 +38,7 @@ class B {
|
|||
op(String x) => 123;
|
||||
}
|
||||
|
||||
makeA() native ;
|
||||
makeA() native;
|
||||
|
||||
void setup1() native """
|
||||
// Ensure we are not relying on global names 'A' and 'E'.
|
||||
|
|
|
@ -31,13 +31,12 @@ wrap(cb) {
|
|||
};
|
||||
}
|
||||
|
||||
nativeId(x) native ;
|
||||
nativeId(x) native;
|
||||
|
||||
void setup() native """
|
||||
nativeId = function(x) { return x; }
|
||||
""";
|
||||
|
||||
|
||||
main() {
|
||||
setup();
|
||||
// Make sure the ClickCounter class goes through interceptors.
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
import "native_testing.dart";
|
||||
|
||||
makeCC() native ;
|
||||
makeCC() native;
|
||||
|
||||
void setup() native """
|
||||
function CC() {}
|
||||
|
|
|
@ -13,7 +13,7 @@ class B {
|
|||
var foo;
|
||||
}
|
||||
|
||||
nativeId(x) native ;
|
||||
nativeId(x) native;
|
||||
|
||||
void setup() native """
|
||||
nativeId = function(x) { return x; }
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
|
||||
import "native_testing.dart";
|
||||
|
||||
makeCC() native ;
|
||||
nativeFirst(x, y) native ;
|
||||
makeCC() native;
|
||||
nativeFirst(x, y) native;
|
||||
|
||||
void setup() native """
|
||||
function CC() {}
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
|
||||
import "native_testing.dart";
|
||||
|
||||
makeA() native ;
|
||||
nativeFirst(x, y) native ;
|
||||
makeA() native;
|
||||
nativeFirst(x, y) native;
|
||||
|
||||
void setup() native """
|
||||
nativeFirst = function(x, y) { return x; }
|
||||
|
|
|
@ -13,7 +13,7 @@ class B {
|
|||
var foo;
|
||||
}
|
||||
|
||||
nativeId(x) native ;
|
||||
nativeId(x) native;
|
||||
|
||||
void setup() native """
|
||||
nativeId = function(x) { return x; }
|
||||
|
|
|
@ -44,7 +44,7 @@ makeA = function(){return new A;};
|
|||
self.nativeConstructor(A);
|
||||
""";
|
||||
|
||||
/*A*/ makeA() native ;
|
||||
/*A*/ makeA() native;
|
||||
|
||||
main() {
|
||||
nativeTesting();
|
||||
|
|
|
@ -16,7 +16,7 @@ class Foo {
|
|||
var ab;
|
||||
}
|
||||
|
||||
Foo makeFoo() native ;
|
||||
Foo makeFoo() native;
|
||||
|
||||
void setup() native """
|
||||
function Foo() { this.i = 0; }
|
||||
|
|
|
@ -23,15 +23,15 @@ class B {
|
|||
@Native("X")
|
||||
class X {
|
||||
@JSName('key')
|
||||
int native_key_method() native ;
|
||||
int native_key_method() native;
|
||||
// This should cause B.key to be renamed, but not A.key.
|
||||
|
||||
@JSName('key')
|
||||
int key() native ;
|
||||
int key() native;
|
||||
}
|
||||
|
||||
A makeA() native ;
|
||||
X makeX() native ;
|
||||
A makeA() native;
|
||||
X makeX() native;
|
||||
|
||||
void setup() native """
|
||||
// This code is all inside 'setup' and so not accesible from the global scope.
|
||||
|
|
|
@ -27,14 +27,14 @@ class B implements I {
|
|||
@Native("X")
|
||||
class X {
|
||||
@JSName('key')
|
||||
int native_key_method() native ;
|
||||
int native_key_method() native;
|
||||
// This should cause B.key to be renamed, but not A.key.
|
||||
@JSName('key')
|
||||
int key() native ;
|
||||
int key() native;
|
||||
}
|
||||
|
||||
A makeA() native ;
|
||||
X makeX() native ;
|
||||
A makeA() native;
|
||||
X makeX() native;
|
||||
|
||||
void setup() native """
|
||||
// This code is all inside 'setup' and so not accesible from the global scope.
|
||||
|
|
|
@ -12,6 +12,6 @@ import 'dart:_js_helper';
|
|||
// Native impl has same name as abstract class.
|
||||
@Native("I")
|
||||
class Impl implements I {
|
||||
Impl read() native ;
|
||||
write(Impl x) native ;
|
||||
Impl read() native;
|
||||
write(Impl x) native;
|
||||
}
|
||||
|
|
|
@ -11,10 +11,10 @@ typedef int Int2Int(int x);
|
|||
|
||||
@Native("A")
|
||||
class A {
|
||||
int foo([x, y, z]) native ;
|
||||
int foo([x, y, z]) native;
|
||||
|
||||
// Calls can be inlined provided they don't pass an argument.
|
||||
int callFun([Int2Int fn]) native ;
|
||||
int callFun([Int2Int fn]) native;
|
||||
}
|
||||
|
||||
class B {
|
||||
|
@ -49,9 +49,9 @@ class B {
|
|||
}
|
||||
}
|
||||
|
||||
A makeA() native ;
|
||||
A makeA() native;
|
||||
|
||||
String findMethodTextContaining(instance, string) native ;
|
||||
String findMethodTextContaining(instance, string) native;
|
||||
|
||||
void setup() native r"""
|
||||
function A() {}
|
||||
|
|
|
@ -10,16 +10,16 @@ import 'dart:_js_helper' show Native, JSName;
|
|||
@Native("A")
|
||||
class A {
|
||||
@JSName('fooA')
|
||||
int foo() native ;
|
||||
int foo() native;
|
||||
|
||||
@JSName('barA')
|
||||
int bar() native ;
|
||||
int bar() native;
|
||||
|
||||
@JSName('bazA')
|
||||
int baz() native ;
|
||||
int baz() native;
|
||||
}
|
||||
|
||||
A makeA() native ;
|
||||
A makeA() native;
|
||||
|
||||
class B {
|
||||
int bar([x]) => 800;
|
||||
|
|
|
@ -9,17 +9,17 @@ import "native_testing.dart";
|
|||
@Native("A")
|
||||
class A {
|
||||
@JSName('fooA')
|
||||
int foo() native ;
|
||||
int foo() native;
|
||||
}
|
||||
|
||||
@Native("B")
|
||||
class B extends A {
|
||||
@JSName('fooB')
|
||||
int foo() native ;
|
||||
int foo() native;
|
||||
}
|
||||
|
||||
makeA() native ;
|
||||
makeB() native ;
|
||||
makeA() native;
|
||||
makeB() native;
|
||||
|
||||
void setup() native """
|
||||
// This code is all inside 'setup' and so not accesible from the global scope.
|
||||
|
|
|
@ -10,13 +10,13 @@ import 'native_testing.dart';
|
|||
@Native("A")
|
||||
class A {
|
||||
@JSName('fooA')
|
||||
int foo() native ;
|
||||
int foo() native;
|
||||
}
|
||||
|
||||
@Native("B")
|
||||
class B extends A {
|
||||
@JSName('fooB')
|
||||
int foo() native ;
|
||||
int foo() native;
|
||||
int fooA() => 333;
|
||||
}
|
||||
|
||||
|
@ -25,8 +25,8 @@ class Decoy {
|
|||
int fooB() => 999;
|
||||
}
|
||||
|
||||
makeA() native ;
|
||||
makeB() native ;
|
||||
makeA() native;
|
||||
makeB() native;
|
||||
|
||||
void setup() native """
|
||||
// This code is all inside 'setup' and so not accesible from the global scope.
|
||||
|
|
|
@ -8,10 +8,10 @@ import 'native_testing.dart';
|
|||
|
||||
@Native("A")
|
||||
class A {
|
||||
int delete() native ;
|
||||
int delete() native;
|
||||
}
|
||||
|
||||
A makeA() native ;
|
||||
A makeA() native;
|
||||
|
||||
void setup() native """
|
||||
function A() {}
|
||||
|
|
|
@ -7,7 +7,7 @@ import 'native_testing.dart';
|
|||
@Native("A")
|
||||
class A {}
|
||||
|
||||
A makeA() native ;
|
||||
A makeA() native;
|
||||
|
||||
void setup() native """
|
||||
function A() {};
|
||||
|
|
|
@ -3,10 +3,11 @@
|
|||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
import 'native_testing.dart';
|
||||
|
||||
@Native("A")
|
||||
class A {}
|
||||
|
||||
A makeA() native ;
|
||||
A makeA() native;
|
||||
|
||||
void setup() native """
|
||||
function A() {};
|
||||
|
|
|
@ -26,8 +26,8 @@ class M2 {
|
|||
var buz;
|
||||
}
|
||||
|
||||
A makeA() native ;
|
||||
B makeB() native ;
|
||||
A makeA() native;
|
||||
B makeB() native;
|
||||
|
||||
void setup() native """
|
||||
function A() {this.foo='A-foo';}
|
||||
|
@ -39,7 +39,6 @@ self.nativeConstructor(A);
|
|||
self.nativeConstructor(B);
|
||||
""";
|
||||
|
||||
|
||||
main() {
|
||||
nativeTesting();
|
||||
setup();
|
||||
|
|
|
@ -24,7 +24,7 @@ class M2 {
|
|||
|
||||
class M3 {}
|
||||
|
||||
makeB() native ;
|
||||
makeB() native;
|
||||
|
||||
void setup() native """
|
||||
function B() {}
|
||||
|
|
|
@ -34,9 +34,9 @@ class C extends B {
|
|||
foo() => 'C.foo';
|
||||
}
|
||||
|
||||
makeA() native ;
|
||||
makeB() native ;
|
||||
makeC() native ;
|
||||
makeA() native;
|
||||
makeB() native;
|
||||
makeC() native;
|
||||
|
||||
void setup() native """
|
||||
function A() {}
|
||||
|
|
|
@ -26,8 +26,8 @@ class M2 {
|
|||
foo() => "M2-foo";
|
||||
}
|
||||
|
||||
A makeA() native ;
|
||||
B makeB() native ;
|
||||
A makeA() native;
|
||||
B makeB() native;
|
||||
|
||||
void setup() native """
|
||||
function A() {}
|
||||
|
|
|
@ -22,8 +22,8 @@ class M {
|
|||
bar() => "M-bar";
|
||||
}
|
||||
|
||||
A makeA() native ;
|
||||
B makeB() native ;
|
||||
A makeA() native;
|
||||
B makeB() native;
|
||||
|
||||
void setup() native """
|
||||
function A() {}
|
||||
|
|
|
@ -37,8 +37,8 @@ class D extends C with M {
|
|||
get mm => 'D.mm($cc)';
|
||||
}
|
||||
|
||||
makeA() native ;
|
||||
makeB() native ;
|
||||
makeA() native;
|
||||
makeB() native;
|
||||
|
||||
void setup() native """
|
||||
function A() {this.aa = 'aa'}
|
||||
|
|
|
@ -19,10 +19,10 @@ class A {
|
|||
return makeA(v);
|
||||
}
|
||||
|
||||
foo() native ;
|
||||
foo() native;
|
||||
}
|
||||
|
||||
makeA(v) native ;
|
||||
makeA(v) native;
|
||||
|
||||
void setup() native """
|
||||
// This code is all inside 'setup' and so not accesible from the global scope.
|
||||
|
|
|
@ -18,10 +18,10 @@ class A {
|
|||
// Only functions with zero parameters are allowed with "native r'...'".
|
||||
factory A.nativeConstructor() native r'return makeA(102);';
|
||||
|
||||
foo() native ;
|
||||
foo() native;
|
||||
}
|
||||
|
||||
makeA(v) native ;
|
||||
makeA(v) native;
|
||||
|
||||
void setup() native """
|
||||
// This code is all inside 'setup' and so not accesible from the global scope.
|
||||
|
|
|
@ -9,11 +9,11 @@ class A {}
|
|||
|
||||
@Native("B")
|
||||
class B extends A {
|
||||
foo() native ;
|
||||
foo() native;
|
||||
}
|
||||
|
||||
makeA() native ;
|
||||
makeB() native ;
|
||||
makeA() native;
|
||||
makeB() native;
|
||||
|
||||
setup() native """
|
||||
function inherits(child, parent) {
|
||||
|
|
|
@ -26,7 +26,7 @@ class C {
|
|||
noSuchMethod(x) => "${getName(x)}:${x.positionalArguments}";
|
||||
}
|
||||
|
||||
makeA() native ;
|
||||
makeA() native;
|
||||
|
||||
setup() native """
|
||||
function A() {}
|
||||
|
|
|
@ -23,7 +23,7 @@ class B {
|
|||
baz() => 42;
|
||||
}
|
||||
|
||||
makeA() native ;
|
||||
makeA() native;
|
||||
|
||||
setup() native """
|
||||
function A() {}
|
||||
|
|
|
@ -28,7 +28,7 @@ class C {
|
|||
noSuchMethod(x) => "${getName(x)}:${x.positionalArguments}";
|
||||
}
|
||||
|
||||
makeA() native ;
|
||||
makeA() native;
|
||||
|
||||
setup() native """
|
||||
function A() {}
|
||||
|
|
|
@ -14,7 +14,7 @@ class B {
|
|||
foo() => 42;
|
||||
}
|
||||
|
||||
makeA() native ;
|
||||
makeA() native;
|
||||
|
||||
setup() native """
|
||||
function A() {}
|
||||
|
|
|
@ -9,11 +9,11 @@ import 'native_testing.dart';
|
|||
@Native("HTMLElement")
|
||||
class Element {
|
||||
String dartMethod(int x) => 'dartMethod(${nativeMethod(x+1)})';
|
||||
String nativeMethod(int x) native ;
|
||||
String nativeMethod(int x) native;
|
||||
}
|
||||
|
||||
makeE() native ;
|
||||
makeF() native ;
|
||||
makeE() native;
|
||||
makeF() native;
|
||||
|
||||
void setup() native """
|
||||
// A novel HTML element.
|
||||
|
|
|
@ -10,12 +10,12 @@ typedef void MyFunctionType();
|
|||
|
||||
@Native("A")
|
||||
class A {
|
||||
setClosure(MyFunctionType f) native ;
|
||||
check(MyFunctionType f) native ;
|
||||
invoke() native ;
|
||||
setClosure(MyFunctionType f) native;
|
||||
check(MyFunctionType f) native;
|
||||
invoke() native;
|
||||
}
|
||||
|
||||
makeA() native ;
|
||||
makeA() native;
|
||||
|
||||
void setup() native """
|
||||
function A() {}
|
||||
|
|
|
@ -8,13 +8,13 @@ import "native_testing.dart";
|
|||
|
||||
@Native("A")
|
||||
class A {
|
||||
returnNull() native ;
|
||||
returnUndefined() native ;
|
||||
returnEmptyString() native ;
|
||||
returnZero() native ;
|
||||
returnNull() native;
|
||||
returnUndefined() native;
|
||||
returnEmptyString() native;
|
||||
returnZero() native;
|
||||
}
|
||||
|
||||
A makeA() native ;
|
||||
A makeA() native;
|
||||
|
||||
void setup() native """
|
||||
function A() {}
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
// Native testing library. Provides support for mock @Native classes and
|
||||
// collects common imports.
|
||||
|
||||
|
||||
import "package:expect/expect.dart";
|
||||
import 'dart:_js_helper' show Native;
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ class A {
|
|||
toString() => 'AAA';
|
||||
}
|
||||
|
||||
makeA() native ;
|
||||
makeA() native;
|
||||
|
||||
void setup() native """
|
||||
function A() {}
|
||||
|
|
|
@ -9,14 +9,14 @@ import 'native_testing.dart';
|
|||
|
||||
@Native("NativeA")
|
||||
class A {
|
||||
foo() native ;
|
||||
foo() native;
|
||||
}
|
||||
|
||||
@Native("NativeB")
|
||||
class B extends A {}
|
||||
|
||||
A makeA() native ;
|
||||
B makeB() native ;
|
||||
A makeA() native;
|
||||
B makeB() native;
|
||||
|
||||
void setup() native """
|
||||
function inherits(child, parent) {
|
||||
|
|
|
@ -10,11 +10,11 @@ typedef void Callback2(arg1, arg2);
|
|||
|
||||
@Native("A")
|
||||
class A {
|
||||
foo1(Callback1 closure, [arg1 = 0]) native ;
|
||||
foo2(Callback2 closure, [arg1 = 0, arg2 = 1]) native ;
|
||||
foo1(Callback1 closure, [arg1 = 0]) native;
|
||||
foo2(Callback2 closure, [arg1 = 0, arg2 = 1]) native;
|
||||
}
|
||||
|
||||
A makeA() native ;
|
||||
A makeA() native;
|
||||
|
||||
void setup() native """
|
||||
function A() {}
|
||||
|
|
|
@ -10,12 +10,12 @@ typedef void Callback2(arg1, arg2);
|
|||
|
||||
@Native("A")
|
||||
class A {
|
||||
foo0(Callback0 closure) native ;
|
||||
foo1(Callback1 closure, arg1) native ;
|
||||
foo2(Callback2 closure, arg1, arg2) native ;
|
||||
foo0(Callback0 closure) native;
|
||||
foo1(Callback1 closure, arg1) native;
|
||||
foo2(Callback2 closure, arg1, arg2) native;
|
||||
}
|
||||
|
||||
makeA() native ;
|
||||
makeA() native;
|
||||
|
||||
void setup() native """
|
||||
function A() {}
|
||||
|
|
|
@ -1379,7 +1379,7 @@ testObjectWeaklyTyped(object) {
|
|||
if (object.yieldValue) throw 'incorrect value in "yieldValue"';
|
||||
}
|
||||
|
||||
NativeClassWithOddNames makeNativeClassWithOddNames() native ;
|
||||
NativeClassWithOddNames makeNativeClassWithOddNames() native;
|
||||
|
||||
setup() native """
|
||||
function NativeClassWithOddNames() {}
|
||||
|
|
|
@ -13,8 +13,8 @@ class A {}
|
|||
@Native("TAGY")
|
||||
class B extends A {}
|
||||
|
||||
makeA() native ;
|
||||
makeB() native ;
|
||||
makeA() native;
|
||||
makeB() native;
|
||||
|
||||
void setup() native """
|
||||
// This code is all inside 'setup' and so not accesible from the global scope.
|
||||
|
|
|
@ -16,24 +16,24 @@ typedef int Callback(String s);
|
|||
class AA {
|
||||
// This name is not an identifier, so completely defines how to access method.
|
||||
@JSName('CC.foo')
|
||||
static int foo(String s) native ;
|
||||
static int foo(String s) native;
|
||||
|
||||
// This name is not an identifier, so completely defines how to access method.
|
||||
@JSName('CC.bar')
|
||||
static int bar(Callback c) native ;
|
||||
static int bar(Callback c) native;
|
||||
static int baz(Callback c) {
|
||||
return bar(c);
|
||||
}
|
||||
|
||||
// Compiler should automatically use the tag and the declared name, i.e. call
|
||||
// `CC.lepton`.
|
||||
static int lepton(Callback c) native ;
|
||||
static int lepton(Callback c) native;
|
||||
static int electron(c) => lepton(c);
|
||||
|
||||
// Compiler should automatically use the tag and JSName, i.e. call
|
||||
// `CC.baryon`.
|
||||
@JSName('baryon')
|
||||
static int _baryon(Callback c) native ;
|
||||
static int _baryon(Callback c) native;
|
||||
static int proton(c) => _baryon(c);
|
||||
}
|
||||
|
||||
|
|
|
@ -19,15 +19,15 @@ class B extends A {
|
|||
oof() => 'B';
|
||||
}
|
||||
|
||||
B makeB1() native ;
|
||||
B makeB2() native ;
|
||||
B makeC() native ;
|
||||
B makeB1() native;
|
||||
B makeB2() native;
|
||||
B makeC() native;
|
||||
|
||||
@Creates('=Object')
|
||||
getBPrototype() native ;
|
||||
getBPrototype() native;
|
||||
|
||||
@Creates('=Object')
|
||||
getCPrototype() native ;
|
||||
getCPrototype() native;
|
||||
|
||||
void setup() native r"""
|
||||
function A() {}
|
||||
|
|
|
@ -22,10 +22,10 @@ class B extends A {
|
|||
oof() => 'B';
|
||||
}
|
||||
|
||||
B makeB() native ;
|
||||
B makeB() native;
|
||||
|
||||
@Creates('=Object')
|
||||
getBPrototype() native ;
|
||||
getBPrototype() native;
|
||||
|
||||
void setup() native r"""
|
||||
function A() {}
|
||||
|
|
|
@ -29,10 +29,10 @@ class B extends A with M {
|
|||
// [miz] is introduced only on the mixin-application A+M.
|
||||
}
|
||||
|
||||
B makeB() native ;
|
||||
B makeB() native;
|
||||
|
||||
@Creates('=Object')
|
||||
getBPrototype() native ;
|
||||
getBPrototype() native;
|
||||
|
||||
void setup() native r"""
|
||||
function B() {}
|
||||
|
|
|
@ -27,10 +27,10 @@ class B extends A with M {
|
|||
callMiz() => this.miz();
|
||||
}
|
||||
|
||||
B makeB() native ;
|
||||
B makeB() native;
|
||||
|
||||
@Creates('=Object')
|
||||
getBPrototype() native ;
|
||||
getBPrototype() native;
|
||||
|
||||
void setup() native r"""
|
||||
function B() {}
|
||||
|
|
|
@ -34,10 +34,10 @@ class Checks<T> {
|
|||
}
|
||||
}
|
||||
|
||||
makeB() native ;
|
||||
makeB() native;
|
||||
|
||||
@Creates('=Object')
|
||||
getBPrototype() native ;
|
||||
getBPrototype() native;
|
||||
|
||||
void setup() native r"""
|
||||
function B() {}
|
||||
|
|
|
@ -55,10 +55,10 @@ class B extends A {
|
|||
get increment => 20;
|
||||
}
|
||||
|
||||
makeB() native ;
|
||||
makeB() native;
|
||||
|
||||
@Creates('=Object')
|
||||
getBPrototype() native ;
|
||||
getBPrototype() native;
|
||||
|
||||
void setup() native r"""
|
||||
function B() { this.a2 = 102; }
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue