summaryrefslogtreecommitdiff
path: root/jstests/core/numberlong.js
diff options
context:
space:
mode:
authorJason Carey <jcarey@argv.me>2016-02-11 14:13:17 -0500
committerJason Carey <jcarey@argv.me>2016-02-11 14:13:17 -0500
commitbe3b2f40fee1b5c197d4e8e49a6185488f8d9403 (patch)
tree9ba463fb00bc99230f0fafd2846a28fcedb32a6c /jstests/core/numberlong.js
parent2b9f5781b1a3cbcd03f24aee935bbc76a550d3ea (diff)
downloadmongo-be3b2f40fee1b5c197d4e8e49a6185488f8d9403.tar.gz
Revert "SERVER-22461 Crash in mozjs code with invalid NumberLong objectt"
This reverts commit ac424fe0c912f1e5553d40f79a168d09ccffef31.
Diffstat (limited to 'jstests/core/numberlong.js')
-rw-r--r--jstests/core/numberlong.js30
1 files changed, 1 insertions, 29 deletions
diff --git a/jstests/core/numberlong.js b/jstests/core/numberlong.js
index acbde248889..4f1d27d6cb0 100644
--- a/jstests/core/numberlong.js
+++ b/jstests/core/numberlong.js
@@ -25,21 +25,6 @@ a.a = n;
p = tojson( a );
assert.eq.automsg( "'{ \"a\" : NumberLong(-4) }'", "p" );
-// double
-n = new NumberLong(4294967296); // 2^32
-assert.eq.automsg( "4294967296", "n" );
-assert.eq.automsg( "4294967296", "n.toNumber()" );
-assert.eq.automsg( "4294967295", "n - 1" );
-assert.eq.automsg( "'NumberLong(\"4294967296\")'", "n.toString()" );
-assert.eq.automsg( "'NumberLong(\"4294967296\")'", "tojson( n )" );
-assert.eq.automsg( "4294967296", "n.floatApprox" );
-assert.eq.automsg( "", "n.top" );
-assert.eq.automsg( "", "n.bottom" );
-a = {}
-a.a = n;
-p = tojson( a );
-assert.eq.automsg( "'{ \"a\" : NumberLong(\"4294967296\") }'", "p" );
-
// too big to fit in double
n = new NumberLong( "11111111111111111" );
assert.eq.automsg( "11111111111111112", "n.toNumber()" );
@@ -59,24 +44,11 @@ assert.eq.automsg( "-11111111111111112", "n.toNumber()" );
assert.eq.automsg( "-11111111111111108", "n + 4" );
assert.eq.automsg( "'NumberLong(\"-11111111111111111\")'", "n.toString()" );
assert.eq.automsg( "'NumberLong(\"-11111111111111111\")'", "tojson( n )" );
-assert.eq.automsg( "-11111111111111112", "n.floatApprox" );
-assert.eq.automsg( "4292380288", "n.top" );
-assert.eq.automsg( "3643379257", "n.bottom" );
-a = {}
+a = {};
a.a = n;
p = tojson( a );
assert.eq.automsg( "'{ \"a\" : NumberLong(\"-11111111111111111\") }'", "p" );
-n = new NumberLong( "9223372036854775807" );
-assert.eq.automsg( "9223372036854775807", "n.floatApprox" );
-assert.eq.automsg( "2147483647", "n.top" );
-assert.eq.automsg( "4294967295", "n.bottom" );
-
-n = new NumberLong( 9223372036854775807, 2147483647, 4294967295 );
-assert.eq.automsg( "9223372036854775807", "n.floatApprox" );
-assert.eq.automsg( "2147483647", "n.top" );
-assert.eq.automsg( "4294967295", "n.bottom" );
-
// parsing
assert.throws.automsg( function() { new NumberLong( "" ); } );
assert.throws.automsg( function() { new NumberLong( "y" ); } );