File tree 1 file changed +6
-3
lines changed 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -66,15 +66,18 @@ global.eval = new host.Proxy(eval_, makeCheckFunction('eval'));
66
66
if ( Promise ) {
67
67
68
68
Promise . prototype . then = new host . Proxy ( Promise . prototype . then , makeCheckFunction ( 'promise_then' ) ) ;
69
- Contextify . connect ( host . Promise . prototype . then , Promise . prototype . then ) ;
69
+ // This seems not to work, and will produce
70
+ // UnhandledPromiseRejectionWarning: TypeError: Method Promise.prototype.then called on incompatible receiver [object Object].
71
+ // This is likely caused since the host.Promise.prototype.then cannot use the VM Proxy object.
72
+ // Contextify.connect(host.Promise.prototype.then, Promise.prototype.then);
70
73
71
74
if ( Promise . prototype . finally ) {
72
75
Promise . prototype . finally = new host . Proxy ( Promise . prototype . finally , makeCheckFunction ( 'promise_finally' ) ) ;
73
- Contextify . connect ( host . Promise . prototype . finally , Promise . prototype . finally ) ;
76
+ // Contextify.connect(host.Promise.prototype.finally, Promise.prototype.finally);
74
77
}
75
78
if ( Promise . prototype . catch ) {
76
79
Promise . prototype . catch = new host . Proxy ( Promise . prototype . catch , makeCheckFunction ( 'promise_catch' ) ) ;
77
- Contextify . connect ( host . Promise . prototype . catch , Promise . prototype . catch ) ;
80
+ // Contextify.connect(host.Promise.prototype.catch, Promise.prototype.catch);
78
81
}
79
82
80
83
}
You can’t perform that action at this time.
0 commit comments