diff options
author | Eliot Horowitz <eliot@10gen.com> | 2010-09-01 01:32:04 -0400 |
---|---|---|
committer | Eliot Horowitz <eliot@10gen.com> | 2010-09-01 01:32:35 -0400 |
commit | b416e09061258dcb0af8ab30147b0eb0dcb0cbf1 (patch) | |
tree | 48aef2ffc076ef1863c95c1984b4c9ec9f9e2bd6 /scripting/engine_spidermonkey.cpp | |
parent | a6e3b04263d32885d4462d4b34c7f77badef820e (diff) | |
download | mongo-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.cpp | 9 |
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 ){ |