diff options
author | Eliot Horowitz <eliot@10gen.com> | 2009-05-20 16:43:43 -0400 |
---|---|---|
committer | Eliot Horowitz <eliot@10gen.com> | 2009-05-20 16:43:43 -0400 |
commit | 0bcbdbc3ec2b82a69255c91253f57a9b3544c5c7 (patch) | |
tree | a5c658c4fe8567f24a578ccf191e0a68a29c3802 /scripting | |
parent | 7155f7aa558dd6241179a5d3aff6200d1836ec7f (diff) | |
download | mongo-0bcbdbc3ec2b82a69255c91253f57a9b3544c5c7.tar.gz |
some js safety stuff MINOR
Diffstat (limited to 'scripting')
-rw-r--r-- | scripting/engine_spidermonkey.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/scripting/engine_spidermonkey.cpp b/scripting/engine_spidermonkey.cpp index ba3832af351..08d98e15bd8 100644 --- a/scripting/engine_spidermonkey.cpp +++ b/scripting/engine_spidermonkey.cpp @@ -17,14 +17,20 @@ namespace mongo { public: BSONHolder( BSONObj obj ){ - _obj = obj; + _obj = obj.getOwned(); _inResolve = false; + _magic = 17; } + void check(){ + uassert( "holder magic value is wrong" , _magic == 17 ); + } + BSONFieldIterator * it(); BSONObj _obj; bool _inResolve; + char _magic; list<string> _extra; }; @@ -527,6 +533,8 @@ namespace mongo { Convertor c( cx ); BSONHolder * holder = GETHOLDER( cx , obj ); + holder->check(); + string s = c.toString( id ); BSONElement e = holder->_obj[ s.c_str() ]; |