Files
sdk/pkg/compiler/test/rti/emission/jsinterop.dart
T
Joshua Litt 7e39d33f05 [dart2js] Add type use for using a class only for its constructor.
Change-Id: I8a7e031045811962998229d25463c74b88ca311e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/156140
Commit-Queue: Joshua Litt <joshualitt@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2020-07-30 22:30:14 +00:00

61 lines
1.0 KiB
Dart

// Copyright (c) 2018, 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.
// @dart = 2.7
@JS()
library jsinterop;
/*class: global#JavaScriptObject:checks=[$isA,$isC],instance*/
import 'package:js/js.dart';
/*class: A:checkedInstance,checks=[],instance,onlyForRti*/
@JS()
class A {
external A();
}
/*class: B:checks=[],instance,onlyForRti*/
@JS('BClass')
class B {
external B();
}
/*class: C:checkedInstance,checks=[],instance,onlyForRti*/
@JS()
@anonymous
class C {
external factory C();
}
/*class: D:checks=[],instance,onlyForRti*/
@JS()
@anonymous
class D {
external factory D();
}
/*class: E:checks=[],instance*/
class E {
E();
}
/*class: F:checks=[],instance*/
class F {
F();
}
@pragma('dart2js:noInline')
test(o) => o is A || o is C || o is E;
main() {
test(new A());
test(new B());
test(new C());
test(new D());
test(new E());
test(new F());
}