dart-sdk/tests/lib/js/no_library_annotation_test.dart
Sigmund Cherem 0845ebaad8 [ddc] Do not require a @JS annotation at the library level.
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>
2021-01-20 22:11:23 +00:00

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"));
}