revert changes to dev utils, apply changes to system utils

This commit is contained in:
Ryan Jones 2016-11-28 17:18:31 -08:00
parent 68e86da023
commit 3961dbcf55
2 changed files with 11 additions and 39 deletions

View file

@ -6,34 +6,6 @@
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // 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) { vec3toStr = function(v, digits) {
if (!digits) { digits = 3; } if (!digits) { digits = 3; }
return "{ " + v.x.toFixed(digits) + ", " + v.y.toFixed(digits) + ", " + v.z.toFixed(digits)+ " }"; return "{ " + v.x.toFixed(digits) + ", " + v.y.toFixed(digits) + ", " + v.z.toFixed(digits)+ " }";

View file

@ -7,31 +7,31 @@
// //
if (!Function.prototype.bind) { if (!Function.prototype.bind) {
Function.prototype.bind = function(oThis) { Function.prototype.bind = function(oThis) {
if (typeof this !== 'function') { if (typeof this !== 'function') {
// closest thing possible to the ECMAScript 5 // closest thing possible to the ECMAScript 5
// internal IsCallable function // internal IsCallable function
throw new TypeError('Function.prototype.bind - what is trying to be bound is not callable'); throw new TypeError('Function.prototype.bind - what is trying to be bound is not callable');
} }
var aArgs = Array.prototype.slice.call(arguments, 1), var aArgs = Array.prototype.slice.call(arguments, 1),
fToBind = this, fToBind = this,
fNOP = function() {}, fNOP = function() {},
fBound = function() { fBound = function() {
return fToBind.apply(this instanceof fNOP return fToBind.apply(this instanceof fNOP
? this ? this
: oThis, : oThis,
aArgs.concat(Array.prototype.slice.call(arguments))); aArgs.concat(Array.prototype.slice.call(arguments)));
}; };
if (this.prototype) { if (this.prototype) {
// Function.prototype doesn't have a prototype property // Function.prototype doesn't have a prototype property
fNOP.prototype = this.prototype; fNOP.prototype = this.prototype;
} }
fBound.prototype = new fNOP(); fBound.prototype = new fNOP();
return fBound; return fBound;
}; };
} }
vec3toStr = function(v, digits) { vec3toStr = function(v, digits) {