blob: bdda86f374a42c54bd752968faacd75c6b7428fa [file] [log] [blame]
// Copyright (c) 2014, 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 "native_testing.dart";
class A {
var foo;
class B {
var foo;
nativeId(x) native;
void setup() {
JS('', r"""
self.nativeId = function(x) { return x; }
main() {
var b = new B(); = (x) => x + 1;
b = nativeId(b); // Inferrer doesn't know if A has been instantiated.
// At this point b could be A or B. The call to "foo" thus needs to go through
// an interceptor. Tests that the interceptor works for retrieving the Dart
// class field and invoking the closure.