20056805f7
Bug: #61550 Change-Id: I6a6a696405a6a8df62c3088fb3f7bdba2e27b783 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/450967 Reviewed-by: Srujan Gaddam <srujzs@google.com>
27 lines
555 B
Dart
27 lines
555 B
Dart
// Copyright (c) 2023, 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.
|
|
|
|
import 'dart:js_interop';
|
|
|
|
import 'package:expect/expect.dart';
|
|
|
|
@JS()
|
|
external void eval(String code);
|
|
|
|
@JS()
|
|
external String get jsString;
|
|
|
|
void main() {
|
|
eval(r'''
|
|
globalThis.jsString = "hi";
|
|
''');
|
|
|
|
switch (jsString) {
|
|
case "hi":
|
|
break;
|
|
default:
|
|
Expect.fail("Unexpected JS String: $jsString");
|
|
}
|
|
}
|