update test.dart

This commit is contained in:
shenjack 2024-03-05 12:29:56 +08:00
parent d0084c774f
commit 65f758b5f6
Signed by: shenjack
GPG Key ID: 7B1134A979775551
2 changed files with 44 additions and 9 deletions

View File

@ -946,6 +946,9 @@
getIsolateAffinityTag($name) {
return init.getIsolateTag($name);
},
defineProperty(obj, property, value) {
Object.defineProperty(obj, property, { value: value, enumerable: false, writable: true, configurable: true });
},
lookupAndCacheInterceptor(obj) {
var interceptor, interceptorClass, altTag, mark, t1,
tag = A._asString($.getTagFunction.call$1(obj)),
@ -3290,6 +3293,10 @@
},
DomException: function DomException() {
},
_FrozenElementList: function _FrozenElementList(t0, t1) {
this._nodeList = t0;
this.$ti = t1;
},
Element: function Element() {
},
EventTarget: function EventTarget() {
@ -3317,14 +3324,21 @@
_NodeList_JavaScriptObject_ListMixin_ImmutableListMixin: function _NodeList_JavaScriptObject_ListMixin_ImmutableListMixin() {
},
main() {
var t2, a, i, b,
var t3, t4, a, i, b,
_s13_ = "Hello, World!",
t1 = document;
t1.querySelector("#an-id").toString;
t1.querySelector(".a-class").toString;
t2 = type$.Element;
A.checkTypeBound(t2, t2, "T", "querySelectorAll");
t1.querySelectorAll("div").toString;
t1 = document,
t2 = t1.querySelector("#an-id");
t2.toString;
t3 = t1.querySelector(".a-class");
t3.toString;
t4 = type$.Element;
A.checkTypeBound(t4, t4, "T", "querySelectorAll");
t4 = t1.querySelectorAll("div");
t4.toString;
A.print(t2);
A.print(t3);
A.print(new A._FrozenElementList(t4, type$._FrozenElementList_Element));
t1.querySelector("#inputs").appendChild(t2).toString;
A.print(_s13_);
for (a = _s13_, i = 0; i < 10; ++i)
a += " " + B.JSInt_methods.toString$0(i);
@ -4133,7 +4147,9 @@
},
toString$0(receiver) {
return A.Iterable_iterableToFullString(receiver, "[", "]");
}
},
$isIterable: 1,
$isList: 1
};
A.Duration.prototype = {
toString$0(_) {
@ -4312,6 +4328,17 @@
return t1;
}
};
A._FrozenElementList.prototype = {
get$length(_) {
return this._nodeList.length;
},
$index(_, index) {
var t1 = this._nodeList;
if (!(index >= 0 && index < t1.length))
return A.ioore(t1, index);
return this.$ti._precomputed1._as(t1[index]);
}
};
A.Element.prototype = {
toString$0(receiver) {
var t1 = receiver.localName;
@ -4446,6 +4473,7 @@
_inheritMany(A.Node, [A.Element, A.CharacterData]);
_inherit(A.HtmlElement, A.Element);
_inheritMany(A.HtmlElement, [A.AnchorElement, A.AreaElement, A.FormElement, A.SelectElement]);
_inherit(A._FrozenElementList, A.ListBase);
_inherit(A._NodeList_JavaScriptObject_ListMixin_ImmutableListMixin, A._NodeList_JavaScriptObject_ListMixin);
_inherit(A.NodeList, A._NodeList_JavaScriptObject_ListMixin_ImmutableListMixin);
_mixin(A._NodeList_JavaScriptObject_ListMixin, A.ListBase);
@ -4460,7 +4488,7 @@
leafTags: null,
arrayRti: Symbol("$ti")
};
A._Universe_addRules(init.typeUniverse, JSON.parse('{"PlainJavaScriptObject":"LegacyJavaScriptObject","UnknownJavaScriptObject":"LegacyJavaScriptObject","JavaScriptFunction":"LegacyJavaScriptObject","MathMLElement":"Element","AudioElement":"HtmlElement","MediaElement":"HtmlElement","HtmlDocument":"Node","Document":"Node","CDataSection":"CharacterData","Text":"CharacterData","JSBool":{"bool":[],"TrustedGetRuntimeType":[]},"JSNull":{"Null":[],"TrustedGetRuntimeType":[]},"JSArray":{"List":["1"],"Iterable":["1"]},"JSUnmodifiableArray":{"JSArray":["1"],"List":["1"],"Iterable":["1"]},"JSNumber":{"num":[]},"JSInt":{"int":[],"num":[],"TrustedGetRuntimeType":[]},"JSNumNotInt":{"num":[],"TrustedGetRuntimeType":[]},"JSString":{"String":[],"TrustedGetRuntimeType":[]},"LateError":{"Error":[]},"NullError":{"TypeError":[],"Error":[]},"JsNoSuchMethodError":{"Error":[]},"UnknownJsTypeError":{"Error":[]},"_StackTrace":{"StackTrace":[]},"Closure":{"Function":[]},"Closure0Args":{"Function":[]},"Closure2Args":{"Function":[]},"TearOffClosure":{"Function":[]},"StaticClosure":{"Function":[]},"BoundClosure":{"Function":[]},"_CyclicInitializationError":{"Error":[]},"RuntimeError":{"Error":[]},"_Error":{"Error":[]},"_TypeError":{"TypeError":[],"Error":[]},"_Future":{"Future":["1"]},"AsyncError":{"Error":[]},"_Zone":{"Zone":[]},"_RootZone":{"_Zone":[],"Zone":[]},"AssertionError":{"Error":[]},"TypeError":{"Error":[]},"ArgumentError":{"Error":[]},"RangeError":{"Error":[]},"IndexError":{"Error":[]},"UnsupportedError":{"Error":[]},"UnimplementedError":{"Error":[]},"ConcurrentModificationError":{"Error":[]},"OutOfMemoryError":{"Error":[]},"StackOverflowError":{"Error":[]},"_StringStackTrace":{"StackTrace":[]},"Element":{"Node":[]},"HtmlElement":{"Element":[],"Node":[]},"AnchorElement":{"Element":[],"Node":[]},"AreaElement":{"Element":[],"Node":[]},"CharacterData":{"Node":[]},"FormElement":{"Element":[],"Node":[]},"NodeList":{"ListBase":["Node"],"ImmutableListMixin":["Node"],"List":["Node"],"JavaScriptIndexingBehavior":["Node"],"Iterable":["Node"],"ListBase.E":"Node","ImmutableListMixin.E":"Node"},"SelectElement":{"Element":[],"Node":[]}}'));
A._Universe_addRules(init.typeUniverse, JSON.parse('{"PlainJavaScriptObject":"LegacyJavaScriptObject","UnknownJavaScriptObject":"LegacyJavaScriptObject","JavaScriptFunction":"LegacyJavaScriptObject","MathMLElement":"Element","AudioElement":"HtmlElement","MediaElement":"HtmlElement","HtmlDocument":"Node","Document":"Node","CDataSection":"CharacterData","Text":"CharacterData","JSBool":{"bool":[],"TrustedGetRuntimeType":[]},"JSNull":{"Null":[],"TrustedGetRuntimeType":[]},"JSArray":{"List":["1"],"Iterable":["1"]},"JSUnmodifiableArray":{"JSArray":["1"],"List":["1"],"Iterable":["1"]},"JSNumber":{"num":[]},"JSInt":{"int":[],"num":[],"TrustedGetRuntimeType":[]},"JSNumNotInt":{"num":[],"TrustedGetRuntimeType":[]},"JSString":{"String":[],"TrustedGetRuntimeType":[]},"LateError":{"Error":[]},"NullError":{"TypeError":[],"Error":[]},"JsNoSuchMethodError":{"Error":[]},"UnknownJsTypeError":{"Error":[]},"_StackTrace":{"StackTrace":[]},"Closure":{"Function":[]},"Closure0Args":{"Function":[]},"Closure2Args":{"Function":[]},"TearOffClosure":{"Function":[]},"StaticClosure":{"Function":[]},"BoundClosure":{"Function":[]},"_CyclicInitializationError":{"Error":[]},"RuntimeError":{"Error":[]},"_Error":{"Error":[]},"_TypeError":{"TypeError":[],"Error":[]},"_Future":{"Future":["1"]},"AsyncError":{"Error":[]},"_Zone":{"Zone":[]},"_RootZone":{"_Zone":[],"Zone":[]},"ListBase":{"List":["1"],"Iterable":["1"]},"AssertionError":{"Error":[]},"TypeError":{"Error":[]},"ArgumentError":{"Error":[]},"RangeError":{"Error":[]},"IndexError":{"Error":[]},"UnsupportedError":{"Error":[]},"UnimplementedError":{"Error":[]},"ConcurrentModificationError":{"Error":[]},"OutOfMemoryError":{"Error":[]},"StackOverflowError":{"Error":[]},"_StringStackTrace":{"StackTrace":[]},"Element":{"Node":[]},"HtmlElement":{"Element":[],"Node":[]},"AnchorElement":{"Element":[],"Node":[]},"AreaElement":{"Element":[],"Node":[]},"CharacterData":{"Node":[]},"_FrozenElementList":{"ListBase":["1"],"List":["1"],"Iterable":["1"],"ListBase.E":"1"},"FormElement":{"Element":[],"Node":[]},"NodeList":{"ListBase":["Node"],"ImmutableListMixin":["Node"],"List":["Node"],"JavaScriptIndexingBehavior":["Node"],"Iterable":["Node"],"ListBase.E":"Node","ImmutableListMixin.E":"Node"},"SelectElement":{"Element":[],"Node":[]}}'));
var string$ = {
Error_: "Error handler must accept one Object or one Object and a StackTrace as arguments, and return a value of the returned future's type"
};
@ -4485,6 +4513,7 @@
TrustedGetRuntimeType: findType("TrustedGetRuntimeType"),
TypeError: findType("TypeError"),
UnknownJavaScriptObject: findType("UnknownJavaScriptObject"),
_FrozenElementList_Element: findType("_FrozenElementList<Element>"),
_Future_dynamic: findType("_Future<@>"),
bool: findType("bool"),
bool_Function_Object: findType("bool(Object)"),

View File

@ -12,6 +12,12 @@ void main() {
// Find all elements by tag (<div>).
List<Element> divElements = querySelectorAll('div');
print(idElement);
print(classElement);
print(divElements);
querySelector('#inputs')!.nodes.add(idElement);
print("Hello, World!");
var a = "Hello, World!";
for (var i = 0; i < 10; i++) {