From d0dfb6055e9a17ea1b81b6226d4a40c6462a0781 Mon Sep 17 00:00:00 2001 From: anekos Date: Tue, 8 Nov 2011 03:09:32 +0900 Subject: Should not redefine global object's property --- youtubeamp.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'youtubeamp.js') diff --git a/youtubeamp.js b/youtubeamp.js index 21bd18f..1ab8833 100644 --- a/youtubeamp.js +++ b/youtubeamp.js @@ -42,8 +42,7 @@ (function() { -Function.prototype.bind = function(object) { - var __method = this; +let bind = function(__method, object) { return function() { return __method.apply(object, arguments); }; @@ -56,7 +55,7 @@ function YouTubePlayerController() { } YouTubePlayerController.prototype = { initialize: function() { - this.fuller = this._changeToFull.bind(this); + this.fuller = bind(this._changeToFull, this); }, constants: { -- cgit v1.2.3