blob: 42dfecbf6b88fed24aa9cb410abf375fa1445b5e [file] [log] [blame]
// Copyright (c) 2022, 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.
// Define a JS class in a different library to test that name resolution works
// for non-external factories and static methods. Also uses class type
// parameters to make sure we generate a generic class.
@JS()
library js_interop_non_external_lib;
import 'package:js/js.dart';
@JS('JSClass')
class OtherJSClass<T> {
external OtherJSClass.cons(T t);
factory OtherJSClass(T t) {
field = 'unnamed';
return OtherJSClass.cons(t);
}
factory OtherJSClass.named(T t) {
field = 'named';
return OtherJSClass.cons(t);
}
factory OtherJSClass.redirecting(T t) = OtherJSClass;
static String field = '';
static String get getSet {
return field;
}
static set getSet(String val) {
field = val;
}
static String method() => field;
static T genericMethod<T>(T t) => t;
}