mirror of
https://github.com/dart-lang/sdk
synced 2024-11-02 14:32:24 +00:00
7baeabe0e4
https://github.com/dart-lang/co19/issues/1090 TEST=Standard tryjobs, all changes are in test code only. Change-Id: Ie73174447ab165827335652cf035f85b7510ab55 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/201564 Commit-Queue: Alexander Thomas <athom@google.com> Reviewed-by: Erik Ernst <eernst@google.com> Reviewed-by: Konstantin Shcheglov <scheglov@google.com> Reviewed-by: Bob Nystrom <rnystrom@google.com>
32 lines
643 B
Dart
32 lines
643 B
Dart
// Copyright (c) 2019, 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.
|
|
|
|
// @dart = 2.9
|
|
|
|
import 'dart:_runtime' as dart;
|
|
|
|
import 'package:expect/expect.dart';
|
|
import 'package:js/js.dart';
|
|
|
|
final e = Expando<int>();
|
|
|
|
@JS()
|
|
external void eval(String s);
|
|
|
|
@JS()
|
|
external Object get singleton;
|
|
|
|
void main() {
|
|
eval('''
|
|
if (!self.singleton) {
|
|
self.singleton = {};
|
|
}
|
|
''');
|
|
var o = singleton;
|
|
Expect.equals(null, e[o]);
|
|
e[o] = 1;
|
|
|
|
dart.hotRestart();
|
|
Expect.equals(null, e[o]);
|
|
}
|