javascript - Passing prototype methods -
yesterday, asked question: passing method later evaluation , thought simple passing prototype method, rather calling after access, resets this window. however, today came across code today:
ssharing.sharefilewithgroup( node, groupid, d.resolve, d.reject ); //d angular promise and when sharefilewithgroup calls 3rd or 4th argument in body, correctly calls functions passed d.then, i.e. passed method can locate original object accessed from. rules setting this when calling prototype method? 2 situations seem inconsistent.
edit: understanding passed method d.resolve/reject should not able call functions passed arguments .then, does. question how it? thing can think of if promises built js or methods aren't using prototype , being put in constructed object directly.
Comments
Post a Comment