From 3961dbcf55f48be8c8b303e38ad57de7c3817d53 Mon Sep 17 00:00:00 2001 From: Ryan Jones Date: Mon, 28 Nov 2016 17:18:31 -0800 Subject: [PATCH] revert changes to dev utils, apply changes to system utils --- scripts/developer/libraries/utils.js | 28 ---------------------------- scripts/system/libraries/utils.js | 22 +++++++++++----------- 2 files changed, 11 insertions(+), 39 deletions(-) diff --git a/scripts/developer/libraries/utils.js b/scripts/developer/libraries/utils.js index 64f3b2c9e0..f39f4d7913 100644 --- a/scripts/developer/libraries/utils.js +++ b/scripts/developer/libraries/utils.js @@ -6,34 +6,6 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -if (!Function.prototype.bind) { - Function.prototype.bind = function(oThis) { - if (typeof this !== 'function') { - // closest thing possible to the ECMAScript 5 - // internal IsCallable function - throw new TypeError('Function.prototype.bind - what is trying to be bound is not callable'); - } - - var aArgs = Array.prototype.slice.call(arguments, 1), - fToBind = this, - fNOP = function() {}, - fBound = function() { - return fToBind.apply(this instanceof fNOP - ? this - : oThis, - aArgs.concat(Array.prototype.slice.call(arguments))); - }; - - if (this.prototype) { - // Function.prototype doesn't have a prototype property - fNOP.prototype = this.prototype; - } - fBound.prototype = new fNOP(); - - return fBound; - }; -} - vec3toStr = function(v, digits) { if (!digits) { digits = 3; } return "{ " + v.x.toFixed(digits) + ", " + v.y.toFixed(digits) + ", " + v.z.toFixed(digits)+ " }"; diff --git a/scripts/system/libraries/utils.js b/scripts/system/libraries/utils.js index 6a3f20717e..3d03f51e78 100644 --- a/scripts/system/libraries/utils.js +++ b/scripts/system/libraries/utils.js @@ -7,31 +7,31 @@ // if (!Function.prototype.bind) { - Function.prototype.bind = function(oThis) { +Function.prototype.bind = function(oThis) { if (typeof this !== 'function') { - // closest thing possible to the ECMAScript 5 - // internal IsCallable function - throw new TypeError('Function.prototype.bind - what is trying to be bound is not callable'); + // closest thing possible to the ECMAScript 5 + // internal IsCallable function + throw new TypeError('Function.prototype.bind - what is trying to be bound is not callable'); } var aArgs = Array.prototype.slice.call(arguments, 1), fToBind = this, fNOP = function() {}, fBound = function() { - return fToBind.apply(this instanceof fNOP - ? this - : oThis, - aArgs.concat(Array.prototype.slice.call(arguments))); + return fToBind.apply(this instanceof fNOP + ? this + : oThis, + aArgs.concat(Array.prototype.slice.call(arguments))); }; if (this.prototype) { - // Function.prototype doesn't have a prototype property - fNOP.prototype = this.prototype; + // Function.prototype doesn't have a prototype property + fNOP.prototype = this.prototype; } fBound.prototype = new fNOP(); return fBound; - }; + }; } vec3toStr = function(v, digits) {