diff options
author | Jason Carey <jcarey@argv.me> | 2015-10-06 20:08:03 -0400 |
---|---|---|
committer | Jason Carey <jcarey@argv.me> | 2015-10-06 20:14:01 -0400 |
commit | 95060c27ed2dddcb6343a88f7aa405ed8a935ad7 (patch) | |
tree | ea6d2287cbdb7154d22af6335ae1f56ac7b6aba0 /src/mongo/scripting/mozjs/jsthread.cpp | |
parent | b7104c6f2f597335c6b9890ff6b80243625a6258 (diff) | |
download | mongo-95060c27ed2dddcb6343a88f7aa405ed8a935ad7.tar.gz |
SERVER-19977 Intern JS Strings
Rather than supplying const char*'s throughout our use of the MozJS api,
intern the strings and root their associated ids (to save on string
parsing).
Diffstat (limited to 'src/mongo/scripting/mozjs/jsthread.cpp')
-rw-r--r-- | src/mongo/scripting/mozjs/jsthread.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/mongo/scripting/mozjs/jsthread.cpp b/src/mongo/scripting/mozjs/jsthread.cpp index 35dd5537b5b..2e5ea289d84 100644 --- a/src/mongo/scripting/mozjs/jsthread.cpp +++ b/src/mongo/scripting/mozjs/jsthread.cpp @@ -225,7 +225,7 @@ namespace { JSThreadConfig* getConfig(JSContext* cx, JS::CallArgs args) { JS::RootedValue value(cx); - ObjectWrapper(cx, args.thisv()).getValue("_JSThreadConfig", &value); + ObjectWrapper(cx, args.thisv()).getValue(InternedString::_JSThreadConfig, &value); if (!value.isObject()) uasserted(ErrorCodes::BadValue, "_JSThreadConfig not an object"); @@ -255,7 +255,7 @@ void JSThreadInfo::Functions::init::call(JSContext* cx, JS::CallArgs args) { JSThreadConfig* config = new JSThreadConfig(cx, args); JS_SetPrivate(obj, config); - ObjectWrapper(cx, args.thisv()).setObject("_JSThreadConfig", obj); + ObjectWrapper(cx, args.thisv()).setObject(InternedString::_JSThreadConfig, obj); args.rval().setUndefined(); } |