mirror of
https://github.com/dart-lang/sdk
synced 2024-09-16 01:45:06 +00:00
0845ebaad8
Dart2js allows to declare JS-interp members, even if the enclosing library doesn't have a JS annotation. This relaxes DDC to do the same. Change-Id: I733d1cbb308692d89b8cd443cbde0ed30637e48e Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/177780 Reviewed-by: Srujan Gaddam <srujzs@google.com> Commit-Queue: Sigmund Cherem <sigmund@google.com>
16 lines
453 B
Dart
16 lines
453 B
Dart
// Copyright (c) 2021, 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.
|
|
|
|
// Test that JS-interop works without a @JS annotation on the library itself.
|
|
|
|
import 'package:js/js.dart';
|
|
import 'package:expect/expect.dart';
|
|
|
|
@JS()
|
|
external dynamic eval(String code);
|
|
|
|
void main() {
|
|
Expect.equals(2, eval("2"));
|
|
}
|