mirror of
https://github.com/dart-lang/sdk
synced 2024-09-16 04:16:51 +00:00
114752421d
Multitest usage that didn't involve separating out failures is removed. Static errors are changed to static error tests. Change-Id: I81d7409ead0005b9788ac80d229ac534279f1658 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/142543 Commit-Queue: Srujan Gaddam <srujzs@google.com> Reviewed-by: Sigmund Cherem <sigmund@google.com> Reviewed-by: Bob Nystrom <rnystrom@google.com>
44 lines
1.1 KiB
Dart
44 lines
1.1 KiB
Dart
// Copyright (c) 2020, 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.
|
|
|
|
@JS()
|
|
library js_typed_interop_test;
|
|
|
|
import 'dart:html';
|
|
|
|
import 'package:js/js.dart';
|
|
import 'package:expect/minitest.dart';
|
|
|
|
_injectJs() {
|
|
document.body!.append(new ScriptElement()
|
|
..type = 'text/javascript'
|
|
..innerHtml = r"""
|
|
var Foo = {
|
|
get42: function(b) { return arguments.length >= 1 ? b : 42; }
|
|
};
|
|
""");
|
|
}
|
|
|
|
@JS()
|
|
class Foo {
|
|
external static num get42([num? b = 3
|
|
// TODO(41375): This should be a static error. It's invalid to have a
|
|
// default value.
|
|
]);
|
|
}
|
|
|
|
main() {
|
|
_injectJs();
|
|
|
|
test('call tearoff from dart with default', () {
|
|
var f = Foo.get42;
|
|
// Note: today both SSA and CPS remove the extra argument on static calls,
|
|
// but they fail to do so on tearoffs.
|
|
expect(f(), 3);
|
|
// TODO(41375): Remove this once the above is resolved. This is temporary
|
|
// to track this test failure.
|
|
throw ("This test should not execute. It should fail to compile above.");
|
|
});
|
|
}
|