clousure!

This commit is contained in:
shenjack 2024-03-24 17:49:15 +08:00
parent fcaa1f22a7
commit 5b45628500
Signed by: shenjack
GPG Key ID: 7B1134A979775551
2 changed files with 23 additions and 20 deletions

View File

@ -8706,6 +8706,7 @@
if (c != null) this.add_event_listener(a, b, c, false) if (c != null) this.add_event_listener(a, b, c, false)
}, },
add_event_listener(receiver, type, listener, options) { add_event_listener(receiver, type, listener, options) {
// console.log("index.dart.js add event listener type:", type, "listener:", listener, receiver, listener, options)
return receiver.addEventListener(type, H.convertDartClosureToJS(listener, 1), false) return receiver.addEventListener(type, H.convertDartClosureToJS(listener, 1), false)
}, },
cg(a, b, c, d) { cg(a, b, c, d) {
@ -10154,6 +10155,7 @@
// or call as send_fast // or call as send_fast
d5(a) { d5(a) {
// J.iF(W.hY(this.cy.contentWindow), $.kd(), "*") // J.iF(W.hY(this.cy.contentWindow), $.kd(), "*")
console.log("sending ?? to iframe (fast call)")
this.cy.contentWindow.postMessage("??", "*") this.cy.contentWindow.postMessage("??", "*")
}, },
bD(a) { bD(a) {
@ -11500,7 +11502,7 @@
q($, "pe", "hD", function () { q($, "pe", "hD", function () {
// return t.W.a($.ea().aj("cw", [])) // return t.W.a($.ea().aj("cw", []))
let result = t.W.a($.ea().aj("cw", [])) let result = t.W.a($.ea().aj("cw", []))
console.log("lazy $.hD", result, t.W, t.W.a, $.ea(), $.ea().aj("cw", [])) // console.log("lazy $.hD", result, t.W, t.W.a, $.ea(), $.ea().aj("cw", []))
return result return result
}) })
q($, "pa", "iy", function () { q($, "pa", "iy", function () {

39
md5.js
View File

@ -1001,36 +1001,36 @@
} }
return b return b
}, },
v_(a, b, c, d, e, f) { v_(closure, numberOfArguments, arg1, arg2, arg3, arg4) {
switch (b) { switch (numberOfArguments) {
case 0: case 0:
return a.$0() return closure.$0()
case 1: case 1:
return a.$1(c) return closure.$1(arg1)
case 2: case 2:
return a.$2(c, d) return closure.$2(arg1, arg2)
case 3: case 3:
return a.$3(c, d, e) return closure.$3(arg1, arg2, arg3)
case 4: case 4:
return a.$4(c, d, e, f) return closure.$4(arg1, arg2, arg3, arg4)
} }
throw H.throw_error(new P.kG("Unsupported number of arguments for wrapped closure")) throw H.throw_error(new P.kG("Unsupported number of arguments for wrapped closure"))
}, },
// MARK: convert_dart_closure_to_js_md5 // MARK: convert_dart_closure_to_js_md5
// convertDartClosureToJS // convertDartClosureToJS
convert_dart_closure_to_js_md5(a, b) { convert_dart_closure_to_js_md5(closure, arity) {
var s var func
if (a == null) return null if (closure == null) return null
s = a.$identity func = closure.$identity
// if (!!s) return s // if (!!s) return s
if (s) return s if (func) return func
s = function (c, d, e) { func = function (c, d, e) {
return function (f, g, h, i) { return function (f, g, h, i) {
return e(c, d, f, g, h, i) return e(c, d, f, g, h, i)
} }
}(a, b, H.v_) }(closure, arity, H.v_)
a.$identity = s closure.$identity = func
return s return func
}, },
rL(a2) { rL(a2) {
var s, r, q, p, o, n, m, l, k, j, i = a2.co, var s, r, q, p, o, n, m, l, k, j, i = a2.co,
@ -11346,9 +11346,10 @@
this.add_event_listener(receiver, type, listener, false) this.add_event_listener(receiver, type, listener, false)
} }
}, },
add_event_listener(receiver_, type, listener, options) { add_event_listener(receiver, type, listener, options) {
console.log("md5.js add event listener type:", type, "listener:", listener, receiver_, listener, options) console.log("md5.js add event listener type:", type, "receiver:", receiver, "listener:", listener, options)
return receiver_.addEventListener(type, H.convert_dart_closure_to_js_md5(listener, 1), false) console.log("receiver == window", receiver == window)
return receiver.addEventListener(type, H.convert_dart_closure_to_js_md5(listener, 1), false)
} }
} }
W.cq.prototype = { W.cq.prototype = {