Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function copyArray( pa ) {
- var la = [];
- for (var i=0; i < pa.length; i++)
- la.push( pa[i] );
- return la;
- }
- Function.prototype.bind = function( po ) {
- var __method = this;
- var __args = [];
- // Sometimes errors -- in practice I inline the function as a workaround.
- __args = copyArray( arguments );
- return function() {
- /* bind logic omitted for brevity */
- }
- }
- <SCRIPT src="mycode.js"/>
- <SCRIPT src="mycode.js"></SCRIPT>
- __args = Array.prototype.slice.call(arguments);
- (function() {
- function copyArray(pa) {
- // Details
- }
- Function.prototype.bind = function ( po ) {
- __args = copyArray( arguments );
- }
- })();
Add Comment
Please, Sign In to add comment