diff options
author | portix <portix@gmx.net> | 2014-03-10 22:31:38 +0100 |
---|---|---|
committer | portix <portix@gmx.net> | 2014-03-10 22:31:38 +0100 |
commit | b207c8629e0dadfdb68f44b3ec8bad926c4b8d8c (patch) | |
tree | 2b5615150ebe70a46c0b7609d7fa9e1942117cdd | |
parent | 702f264e2916ea563260b6a4332d956abe918f7b (diff) | |
download | dwb-b207c8629e0dadfdb68f44b3ec8bad926c4b8d8c.zip |
Use js-string comparison function in global_namespace
-rw-r--r-- | src/scripts.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/scripts.c b/src/scripts.c index 5e5dd077..eeac18b5 100644 --- a/src/scripts.c +++ b/src/scripts.c @@ -2328,16 +2328,16 @@ global_namespace(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObject, }; JSValueRef ret = NULL; if (argc > 0) { - char *name = js_value_to_char(ctx, argv[0], PROP_LENGTH, exc); + JSStringRef name = JSValueToStringCopy(ctx, argv[0], exc); if (name != NULL) { for (int i=0; i<NAMESPACE_LAST; i++) { - if (!strcmp(name, mapping[i])) { + if (JSStringIsEqualToUTF8CString(name, mapping[i])) { ret = s_ctx->namespaces[i]; break; } } - g_free(name); } + JSStringRelease(name); } return ret; } |