| Index: tests/html/js_typed_interop_window_property_test.dart
|
| diff --git a/tests/html/js_typed_interop_window_property_test.dart b/tests/html/js_typed_interop_window_property_test.dart
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..0f2bdc6a2bcbe129bd1928aad703e5032993a218
|
| --- /dev/null
|
| +++ b/tests/html/js_typed_interop_window_property_test.dart
|
| @@ -0,0 +1,40 @@
|
| +// Copyright (c) 2016, 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.
|
| +
|
| +@JS()
|
| +library js_typed_interop_window_property_test;
|
| +
|
| +import 'dart:html';
|
| +
|
| +import 'package:js/js.dart';
|
| +import 'package:unittest/unittest.dart';
|
| +import 'package:unittest/html_config.dart';
|
| +import 'package:unittest/html_individual_config.dart';
|
| +
|
| +// This is a regression test for https://github.com/dart-lang/sdk/issues/24817
|
| +
|
| +_injectJs() {
|
| + document.body.append(new ScriptElement()
|
| + ..type = 'text/javascript'
|
| + ..innerHtml = r"""
|
| + "use strict";
|
| +
|
| + window.foo = [function() { return 42; }];
|
| +""");
|
| +}
|
| +
|
| +@JS("window.foo")
|
| +external List<Function> get foo;
|
| +
|
| +main() {
|
| + _injectJs();
|
| +
|
| + useHtmlIndividualConfiguration();
|
| +
|
| + group('bind this', () {
|
| + test('simple', () {
|
| + expect(foo[0](), equals(42));
|
| + });
|
| + });
|
| +}
|
|
|