summaryrefslogtreecommitdiff
path: root/jstests/constructors.js
diff options
context:
space:
mode:
authorMathias Stearn <mathias@10gen.com>2013-06-05 18:23:46 -0400
committerMathias Stearn <mathias@10gen.com>2013-06-17 18:35:10 -0400
commitfda4a2342614e4ca1fb26c868a5adef0e050eb5e (patch)
tree208f6006b8b183320a6b75392e1cef7f457afd02 /jstests/constructors.js
parentc676251944be837ebe285e12ff701e1594c2f70b (diff)
downloadmongo-fda4a2342614e4ca1fb26c868a5adef0e050eb5e.tar.gz
SERVER-9878 Add type checks to V8 C++ bindings
The main focus of this ticket is tightening up input validation in our V8 bindings. Doing this required normalizing the way we create custom types in JS that have special C++-driven behavior. All special types now use FunctionTemplates that are attached to the V8Scope object. This allows us to test if an object is of the correct type before using it. Other related tickets partially addressed: SERVER-8961 Differences in argument validation of custom types between v8 and Spidermonkey SERVER-9803 Handle regular expression parse errors without seg faulting
Diffstat (limited to 'jstests/constructors.js')
-rw-r--r--jstests/constructors.js12
1 files changed, 5 insertions, 7 deletions
diff --git a/jstests/constructors.js b/jstests/constructors.js
index 97b8141363f..6d9e982787d 100644
--- a/jstests/constructors.js
+++ b/jstests/constructors.js
@@ -91,15 +91,14 @@ function whereConstructorTest (constructorList) {
var dbrefConstructors = {
"valid" : [
- // SERVER-8961
- //"DBRef()",
"DBRef(\"namespace\", 0)",
"DBRef(\"namespace\", \"test\")",
"DBRef(\"namespace\", ObjectId())",
"DBRef(\"namespace\", ObjectId(\"000000000000000000000000\"))",
- "DBRef(true, ObjectId())"
],
"invalid" : [
+ "DBRef()",
+ "DBRef(true, ObjectId())",
"DBRef(\"namespace\")",
"DBRef(\"namespace\", ObjectId(), true)"
]
@@ -107,15 +106,14 @@ var dbrefConstructors = {
var dbpointerConstructors = {
"valid" : [
- // SERVER-8961
- //"DBPointer(\"namespace\", 0)",
- //"DBPointer(\"namespace\", \"test\")",
"DBPointer(\"namespace\", ObjectId())",
"DBPointer(\"namespace\", ObjectId(\"000000000000000000000000\"))",
- "DBPointer(true, ObjectId())"
],
"invalid" : [
"DBPointer()",
+ "DBPointer(true, ObjectId())",
+ "DBPointer(\"namespace\", 0)",
+ "DBPointer(\"namespace\", \"test\")",
"DBPointer(\"namespace\")",
"DBPointer(\"namespace\", ObjectId(), true)"
]