blob: faf3460f25c74df1b500d6cfb7f99a6f163c1a84 [file] [log] [blame]
// 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_util';
import 'dart:js_interop';
import 'package:expect/expect.dart';
@JS()
external void eval(String code);
void main() {
eval(r'''
globalThis.jsString = "hi";
''');
String jsString = getProperty(globalThis, "jsString");
switch (jsString) {
case "hi":
break;
default:
Expect.fail("Unexpected JS String: $jsString");
}
}