summaryrefslogtreecommitdiff
path: root/scripting/engine_spidermonkey.cpp
diff options
context:
space:
mode:
authorEliot Horowitz <eliot@10gen.com>2010-09-01 01:32:04 -0400
committerEliot Horowitz <eliot@10gen.com>2010-09-01 01:32:35 -0400
commitb416e09061258dcb0af8ab30147b0eb0dcb0cbf1 (patch)
tree48aef2ffc076ef1863c95c1984b4c9ec9f9e2bd6 /scripting/engine_spidermonkey.cpp
parenta6e3b04263d32885d4462d4b34c7f77badef820e (diff)
downloadmongo-b416e09061258dcb0af8ab30147b0eb0dcb0cbf1.tar.gz
Scope::rename and ability to block db access prep for SERVER-1715
Diffstat (limited to 'scripting/engine_spidermonkey.cpp')
-rw-r--r--scripting/engine_spidermonkey.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/scripting/engine_spidermonkey.cpp b/scripting/engine_spidermonkey.cpp
index cb3ad2092a3..8952b339702 100644
--- a/scripting/engine_spidermonkey.cpp
+++ b/scripting/engine_spidermonkey.cpp
@@ -1323,6 +1323,15 @@ namespace mongo {
}
}
+ void rename( const char * from , const char * to ){
+ smlock;
+ jsval v;
+ assert( JS_GetProperty( _context , _global , from , &v ) );
+ assert( JS_SetProperty( _context , _global , to , &v ) );
+ v = JSVAL_VOID;
+ assert( JS_SetProperty( _context , _global , from , &v ) );
+ }
+
// ---- functions -----
ScriptingFunction _createFunction( const char * code ){