Skip to content

Commit

Permalink
fixed react (and several other callback patching-related problems) #…
Browse files Browse the repository at this point in the history
  • Loading branch information
Domiii committed Jan 11, 2022
1 parent e4965a7 commit 9c60cae
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
18 changes: 9 additions & 9 deletions dbux-runtime/src/async/CallbackPatcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,15 +115,15 @@ export default class CallbackPatcher {
return originalCallback;
}

// let f = getPatchedFunctionOrNull(originalFunction);
// if (!f) {
// const calleePatcher = this.defaultCalleePatcher;

// f = monkeyPatchFunctionOverride(
// originalFunction,
// calleePatcher.bind(this, callId)
// );
// }
let f = getPatchedCallback(originalCallback);
if (f) {
return f;
// const calleePatcher = this.defaultCalleePatcher;
// f = monkeyPatchFunctionOverride(
// originalFunction,
// calleePatcher.bind(this, callId)
// );
}

// const self = this; // NOTE: `this` will be the callback's `this`

Expand Down
1 change: 1 addition & 0 deletions samples/__samplesInput__/patching/callbacks0.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ function nativeCallCompare(cb) {
* and many other callback management mechanisms cannot work correctly.
*/
nativeCallStore(cb);
debugger;
nativeCallCompare(cb);

// TODO: more testing here, with checks for multi-patching
Expand Down

0 comments on commit 9c60cae

Please sign in to comment.