summaryrefslogtreecommitdiff
path: root/js/src/jsstr.cpp
diff options
context:
space:
mode:
authorGaming4JC <g4jc@hyperbola.info>2019-06-08 23:46:41 -0400
committerGaming4JC <g4jc@hyperbola.info>2019-07-18 22:38:27 -0400
commit761b3afca59ba1c24337ff3afe0c91d005f7718b (patch)
treee4112b321901610e104693d386eeccdae92bc372 /js/src/jsstr.cpp
parent08aee2f9d9948c9a4540706d40ea4abf01f452a5 (diff)
downloaduxp-761b3afca59ba1c24337ff3afe0c91d005f7718b.tar.gz
1320408 - Part 18: Change StringObject::init to static method.
Diffstat (limited to 'js/src/jsstr.cpp')
-rw-r--r--js/src/jsstr.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/js/src/jsstr.cpp b/js/src/jsstr.cpp
index fdb62a6794..74f61b87dc 100644
--- a/js/src/jsstr.cpp
+++ b/js/src/jsstr.cpp
@@ -2918,7 +2918,10 @@ js::InitStringClass(JSContext* cx, HandleObject obj)
Rooted<JSString*> empty(cx, cx->runtime()->emptyString);
RootedObject proto(cx, GlobalObject::createBlankPrototype(cx, global, &StringObject::class_));
- if (!proto || !proto->as<StringObject>().init(cx, empty))
+ if (!proto)
+ return nullptr;
+ Handle<StringObject*> protoObj = proto.as<StringObject>();
+ if (!StringObject::init(cx, protoObj, empty))
return nullptr;
/* Now create the String function. */