blob: 1701f4f868e54da13232c9de3d9e9544ff8d824a [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.
extension type JSAny(Object value) {}
extension type JSObject(Object value) implements JSAny {}
extension type JSArray(List<JSAny?> value) implements JSObject {}
extension type JSExportedDartObject(Object value) implements JSObject {}
extension type JSNumber(double value) implements JSAny {}
extension ObjectToJSExportedDartObject on Object {
JSExportedDartObject get toJS => JSExportedDartObject(this);
}
extension ListToJSArray on List<JSAny?> {
JSArray get toJS => JSArray(this);
}
extension DoubleToJSNumber on double {
JSNumber get toJS => JSNumber(this);
}
void main() {
JSArray arr = [1.0.toJS, 'foo'.toJS].toJS;
}