numtel / meteor-mysql

Reactive MySQL for Meteor
MIT License
343 stars 41 forks source link

Cannot run meteor after adding this package #21

Open jasonnathan opened 9 years ago

jasonnathan commented 9 years ago

Hi, after installing numtel:mysql, I get this crash log and cannot proceed

 TypeError: Cannot assign to read only property 'random' of function BigNumber( n, b ) {
             var c, e, i, num, len, str,
                 x = this;

             // Enable constructor usage without new.
             if ( !( x instanceof BigNumber ) ) {

                 // 'BigNumber() constructor call without new: {n}'
                 if (ERRORS) raise( 26, 'constructor call without new', n );
                 return new BigNumber( n, b );
             }

             // 'new BigNumber() base not an integer: {b}'
             // 'new BigNumber() base out of range: {b}'
             if ( b == null || !isValidInt( b, 2, 64, id, 'base' ) ) {

                 // Duplicate.
                 if ( n instanceof BigNumber ) {
                     x.s = n.s;
                     x.e = n.e;
                     x.c = ( n = n.c ) ? n.slice() : n;
                     id = 0;
                     return;
                 }

                 if ( ( num = typeof n == 'number' ) && n * 0 == 0 ) {
                     x.s = 1 / n < 0 ? ( n = -n, -1 ) : 1;

                     // Fast path for integers.
                     if ( n === ~~n ) {
                         for ( e = 0, i = n; i >= 10; i /= 10, e++ );
                         x.e = e;
                         x.c = [n];
                         id = 0;
                         return;
                     }

                     str = n + '';
                 } else {
                     if ( !isNumeric.test( str = n + '' ) ) return parseNumeric( x, str, num );
                     x.s = str.charCodeAt(0) === 45 ? ( str = str.slice(1), -1 ) : 1;
                 }
             } else {
                 b = b | 0;
                 str = n + '';

                 // Ensure return value is rounded to DECIMAL_PLACES as with other bases.
                 // Allow exponential notation to be used with base 10 argument.
                 if ( b == 10 ) {
                     x = new BigNumber( n instanceof BigNumber ? n : str );
                     return round( x, DECIMAL_PLACES + x.e + 1, ROUNDING_MODE );
                 }

                 // Avoid potential interpretation of Infinity and NaN as base 44+ values.
                 // Any number in exponential form will fail due to the [Ee][+-].
                 if ( ( num = typeof n == 'number' ) && n * 0 != 0 ||
                   !( new RegExp( '^-?' + ( c = '[' + ALPHABET.slice( 0, b ) + ']+' ) +
                     '(?:\\.' + c + ')?$',b < 37 ? 'i' : '' ) ).test(str) ) {
                     return parseNumeric( x, str, num, b );
                 }

                 if (num) {
                     x.s = 1 / n < 0 ? ( str = str.slice(1), -1 ) : 1;

                     if ( ERRORS && str.replace( /^0\.0*|\./, '' ).length > 15 ) {

                         // 'new BigNumber() number type has more than 15 significant digits: {n}'
                         raise( id, tooManyDigits, n );
                     }

                     // Prevent later check for length on converted number.
                     num = false;
                 } else {
                     x.s = str.charCodeAt(0) === 45 ? ( str = str.slice(1), -1 ) : 1;
                 }

                 str = convertBase( str, 10, b, x.s );
             }

             // Decimal point?
             if ( ( e = str.indexOf('.') ) > -1 ) str = str.replace( '.', '' );

             // Exponential form?
             if ( ( i = str.search( /e/i ) ) > 0 ) {

                 // Determine exponent.
                 if ( e < 0 ) e = i;
                 e += +str.slice( i + 1 );
                 str = str.substring( 0, i );
             } else if ( e < 0 ) {

                 // Integer.
                 e = str.length;
             }

             // Determine leading zeros.
             for ( i = 0; str.charCodeAt(i) === 48; i++ );

             // Determine trailing zeros.
             for ( len = str.length; str.charCodeAt(--len) === 48; );
             str = str.slice( i, len + 1 );

             if (str) {
                 len = str.length;

                 // Disallow numbers with over 15 significant digits if number type.
                 // 'new BigNumber() number type has more than 15 significant digits: {n}'
                 if ( num && ERRORS && len > 15 ) raise( id, tooManyDigits, x.s * n );

                 e = e - i - 1;

                  // Overflow?
                 if ( e > MAX_EXP ) {

                     // Infinity.
                     x.c = x.e = null;

                 // Underflow?
                 } else if ( e < MIN_EXP ) {

                     // Zero.
                     x.c = [ x.e = 0 ];
                 } else {
                     x.e = e;
                     x.c = [];

                     // Transform base

                     // e is the base 10 exponent.
                     // i is where to slice str to get the first element of the coefficient array.
                     i = ( e + 1 ) % LOG_BASE;
                     if ( e < 0 ) i += LOG_BASE;

                     if ( i < len ) {
                         if (i) x.c.push( +str.slice( 0, i ) );

                         for ( len -= LOG_BASE; i < len; ) {
                             x.c.push( +str.slice( i, i += LOG_BASE ) );
                         }

                         str = str.slice(i);
                         i = LOG_BASE - str.length;
                     } else {
                         i -= len;
                     }

                     for ( ; i--; str += '0' );
                     x.c.push( +str );
                 }
             } else {

                 // Zero.
                 x.c = [ x.e = 0 ];
             }

             id = 0;
         }
     at another (.meteor/packages/numtel_mysql/.0.1.9.39pd3t++os+web.browser+web.cordova/npm/node_modules/mysql/node_modules/bignumber.js/bignumber.js:511:26)
     at .meteor/packages/numtel_mysql/.0.1.9.39pd3t++os+web.browser+web.cordova/npm/node_modules/mysql/node_modules/bignumber.js/bignumber.js:2652:17
     at Object.<anonymous> (.meteor/packages/numtel_mysql/.0.1.9.39pd3t++os+web.browser+web.cordova/npm/node_modules/mysql/node_modules/bignumber.js/bignumber.js:2667:3)
     at Module._compile (module.js:456:26)
     at Object.Module._extensions..js (module.js:474:10)
     at Module.load (module.js:356:32)
     at Function.Module._load (module.js:312:12)
     at Module.require (module.js:364:17)
     at require (module.js:380:17)
     at Object.<anonymous> (.meteor/packages/numtel_mysql/.0.1.9.39pd3t++os+web.browser+web.cordova/npm/node_modules/mysql/lib/protocol/Parser.js:4:25)
numtel commented 9 years ago

Does this still occur with the latest version? (0.1.14)