Skip to content
Snippets Groups Projects
Select Git revision
  • 591a72c22426639d09e2bc76745b8df1d15649e9
  • master default protected
2 results

mpipi2.c

Blame
  • three.module.js 1.09 MiB
    // Polyfills
    
    if ( Number.EPSILON === undefined ) {
    
    	Number.EPSILON = Math.pow( 2, - 52 );
    
    }
    
    if ( Number.isInteger === undefined ) {
    
    	// Missing in IE
    	// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isInteger
    
    	Number.isInteger = function ( value ) {
    
    		return typeof value === 'number' && isFinite( value ) && Math.floor( value ) === value;
    
    	};
    
    }
    
    //
    
    if ( Math.sign === undefined ) {
    
    	// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/sign
    
    	Math.sign = function ( x ) {
    
    		return ( x < 0 ) ? - 1 : ( x > 0 ) ? 1 : + x;
    
    	};
    
    }
    
    if ( 'name' in Function.prototype === false ) {
    
    	// Missing in IE
    	// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/name
    
    	Object.defineProperty( Function.prototype, 'name', {
    
    		get: function () {
    
    			return this.toString().match( /^\s*function\s*([^\(\s]*)/ )[ 1 ];
    
    		}
    
    	} );
    
    }
    
    if ( Object.assign === undefined ) {
    
    	// Missing in IE
    	// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign
    
    	Object.assign = function ( target ) {
    
    		if ( target === undefined || target === null ) {
    
    			throw new TypeError( 'Cannot convert undefined or null to object' );
    
    		}
    
    		var output = Object( target );
    
    		for ( var index = 1; index < arguments.length; index ++ ) {
    
    			var source = arguments[ index ];