File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -27,8 +27,10 @@ function Promise(fn) {
27
27
} )
28
28
}
29
29
this . then [ handleSymbol ] = handle ;
30
-
31
30
function handle ( deferred ) {
31
+ return internalHandle ( deferred ) ;
32
+ }
33
+ function internalHandle ( deferred ) {
32
34
if ( state === null ) {
33
35
deferreds . push ( deferred )
34
36
return
@@ -61,10 +63,9 @@ function Promise(fn) {
61
63
// to prevent a memory leak, we adopt the value of the other promise
62
64
// allowing this promise to be garbage collected as soon as nobody
63
65
// has a reference to it
64
- handle = ( self [ handleSymbol ] = then [ handleSymbol ] ) ;
65
- self . then = then ;
66
+ internalHandle = then [ handleSymbol ] ;
66
67
deferreds . forEach ( function ( deferred ) {
67
- handle ( deferred ) ;
68
+ internalHandle ( deferred ) ;
68
69
} ) ;
69
70
} else {
70
71
doResolve ( then . bind ( newValue ) , resolve , reject )
You can’t perform that action at this time.
0 commit comments