+ if (!ctx) {
+ ASSERT_NOT_REACHED();
+ return 0;
+ }
+ ExecState* exec = toJS(ctx);
+ APIEntryShim entryShim(exec);
+ String str = string->string();
+ unsigned length = str.length();
+ if (length && str.is8Bit()) {
+ LiteralParser<LChar> parser(exec, str.characters8(), length, StrictJSON);
+ return toRef(exec, parser.tryLiteralParse());
+ }
+ LiteralParser<UChar> parser(exec, str.characters(), length, StrictJSON);
+ return toRef(exec, parser.tryLiteralParse());