(mPtr, mOnEnter, mOnLeave, needRecord = true)
| 8410 | })(passValueKey || (passValueKey = {})); |
| 8411 | let map_attach_listener = (0, globle_1.GET_MAP)(enum_1.MapKAY.map_attach_listener); |
| 8412 | const attachNative = (mPtr, mOnEnter, mOnLeave, needRecord = true) => { |
| 8413 | if (typeof mPtr == "number") |
| 8414 | mPtr = ptr(mPtr); |
| 8415 | if (mPtr instanceof NativePointer && mPtr.isNull()) |
| 8416 | return; |
| 8417 | var passValue = new Map(); |
| 8418 | passValue.set(passValueKey.org, mPtr); |
| 8419 | passValue.set(passValueKey.src, mPtr); |
| 8420 | passValue.set(passValueKey.enter, mOnEnter); |
| 8421 | passValue.set(passValueKey.leave, mOnLeave); |
| 8422 | passValue.set(passValueKey.time, new Date()); |
| 8423 | mPtr = checkPointer(mPtr); |
| 8424 | let Listener = Interceptor.attach(mPtr, { |
| 8425 | onEnter: function (args) { |
| 8426 | if (mOnEnter != undefined) |
| 8427 | mOnEnter(args, this.context, passValue); |
| 8428 | }, |
| 8429 | onLeave: function (retval) { |
| 8430 | if (mOnLeave != undefined) |
| 8431 | mOnLeave(retval, this.context, passValue); |
| 8432 | } |
| 8433 | }); |
| 8434 | if (needRecord) |
| 8435 | map_attach_listener.set(String(mPtr), Listener); |
| 8436 | }; |
| 8437 | exports.attachNative = attachNative; |
| 8438 | let arr_nop_addr = new Array(); |
| 8439 | var nopFunction = (mPtr) => { |
nothing calls this directly
no test coverage detected