Lines Matching refs:JSHandle
42 JSHandle<EcmaString> pattern = thread->GetEcmaVM()->GetFactory()->NewFromASCII("\\w+");
43 JSHandle<EcmaString> flags = thread->GetEcmaVM()->GetFactory()->NewFromASCII("i");
47 JSHandle<JSTaggedValue> regexpObject(thread, result);
50 JSHandle<JSRegExp> jsRegexp(thread, JSRegExp::Cast(regexpObject->GetTaggedObject()));
51 JSHandle<JSTaggedValue> originalSource(thread, jsRegexp->GetOriginalSource());
53 JSHandle<JSTaggedValue> originalFlags(thread, BuiltinsRegExp::FlagsBitsToString(thread, flagsBits));
54 ASSERT_EQ(EcmaStringAccessor::Compare(instance, JSHandle<EcmaString>(originalSource), pattern), 0);
55 ASSERT_EQ(EcmaStringAccessor::Compare(instance, JSHandle<EcmaString>(originalFlags), flags), 0);
61 JSHandle<EcmaString> pattern = thread->GetEcmaVM()->GetFactory()->NewFromASCII("\\w+");
62 JSHandle<EcmaString> flags = thread->GetEcmaVM()->GetFactory()->NewFromASCII("i");
64 JSHandle<JSRegExp> value(thread, reinterpret_cast<JSRegExp *>(result1.GetRawData()));
66 JSHandle<GlobalEnv> env = thread->GetEcmaVM()->GetGlobalEnv();
67 JSHandle<JSFunction> regexp(env->GetRegExpFunction());
68 JSHandle<JSObject> globalObject(thread, env->GetGlobalObject());
82 JSHandle<JSTaggedValue> regexpObject(thread, result2);
85 JSHandle<JSRegExp> jsRegexp(thread, JSRegExp::Cast(regexpObject->GetTaggedObject()));
86 JSHandle<JSTaggedValue> originalSource(thread, jsRegexp->GetOriginalSource());
88 JSHandle<JSTaggedValue> originalFlags(thread, BuiltinsRegExp::FlagsBitsToString(thread, flagsBits));
89 ASSERT_EQ(EcmaStringAccessor::Compare(instance, JSHandle<EcmaString>(originalSource), pattern), 0);
90 ASSERT_EQ(EcmaStringAccessor::Compare(instance, JSHandle<EcmaString>(originalFlags), flags), 0);
96 JSHandle<EcmaString> pattern1 = thread->GetEcmaVM()->GetFactory()->NewFromASCII("\\w+");
97 JSHandle<EcmaString> flags1 = thread->GetEcmaVM()->GetFactory()->NewFromASCII("i");
99 JSHandle<JSRegExp> value(thread, reinterpret_cast<JSRegExp *>(result1.GetRawData()));
101 JSHandle<GlobalEnv> env = thread->GetEcmaVM()->GetGlobalEnv();
102 JSHandle<JSFunction> regexp(env->GetRegExpFunction());
103 JSHandle<JSObject> globalObject(thread, env->GetGlobalObject());
104 JSHandle<EcmaString> flags2 = thread->GetEcmaVM()->GetFactory()->NewFromASCII("gi");
117 JSHandle<JSTaggedValue> regexpObject(thread, result2);
120 JSHandle<JSRegExp> jsRegexp(thread, JSRegExp::Cast(regexpObject->GetTaggedObject()));
121 JSHandle<JSTaggedValue> originalSource(thread, jsRegexp->GetOriginalSource());
123 JSHandle<JSTaggedValue> originalFlags(thread, BuiltinsRegExp::FlagsBitsToString(thread, flagsBits));
124 ASSERT_EQ(EcmaStringAccessor::Compare(instance, JSHandle<EcmaString>(originalSource), pattern1), 0);
125 ASSERT_EQ(EcmaStringAccessor::Compare(instance, JSHandle<EcmaString>(originalFlags), flags2), 0);
131 JSHandle<EcmaString> pattern1 = thread->GetEcmaVM()->GetFactory()->NewFromASCII("");
132 JSHandle<EcmaString> flags1 = thread->GetEcmaVM()->GetFactory()->NewFromASCII("i");
134 JSHandle<JSTaggedValue> result1Handle(thread, result1);
137 JSHandle<JSTaggedValue> source(
139 JSHandle<JSTaggedValue> sourceResult(JSObject::GetProperty(thread, result1Handle, source).GetValue());
141 JSHandle<EcmaString> expect = thread->GetEcmaVM()->GetFactory()->NewFromASCII("(?:)");
142 ASSERT_EQ(EcmaStringAccessor::Compare(instance, JSHandle<EcmaString>(sourceResult), expect), 0);
148 JSHandle<EcmaString> pattern1 = thread->GetEcmaVM()->GetFactory()->NewFromASCII("/w+");
149 JSHandle<EcmaString> flags1 = thread->GetEcmaVM()->GetFactory()->NewFromASCII("i");
151 JSHandle<JSTaggedValue> result1Handle(thread, result1);
154 JSHandle<JSTaggedValue> source(thread->GetEcmaVM()->GetFactory()->NewFromASCII("source"));
155 JSHandle<JSTaggedValue> sourceResult(JSObject::GetProperty(thread, result1Handle, source).GetValue());
157 JSHandle<EcmaString> expect = thread->GetEcmaVM()->GetFactory()->NewFromASCII("\\/w+");
158 ASSERT_EQ(EcmaStringAccessor::Compare(instance, JSHandle<EcmaString>(sourceResult), expect), 0);
164 JSHandle<EcmaString> pattern1 = thread->GetEcmaVM()->GetFactory()->NewFromASCII("\\w+");
165 JSHandle<EcmaString> flags1 = thread->GetEcmaVM()->GetFactory()->NewFromASCII("gimuy");
167 JSHandle<JSTaggedValue> result1Handle(thread, result1);
169 JSHandle<JSTaggedValue> global(thread->GetEcmaVM()->GetFactory()->NewFromASCII("global"));
174 JSHandle<JSTaggedValue> ignoreCase(thread->GetEcmaVM()->GetFactory()->NewFromASCII("ignoreCase"));
179 JSHandle<JSTaggedValue> multiline(thread->GetEcmaVM()->GetFactory()->NewFromASCII("multiline"));
184 JSHandle<JSTaggedValue> sticky(thread->GetEcmaVM()->GetFactory()->NewFromASCII("sticky"));
189 JSHandle<JSTaggedValue> unicode(thread->GetEcmaVM()->GetFactory()->NewFromASCII("unicode"));
198 JSHandle<EcmaString> pattern1 = thread->GetEcmaVM()->GetFactory()->NewFromASCII("\\w+");
199 JSHandle<EcmaString> flags1 = thread->GetEcmaVM()->GetFactory()->NewFromASCII("imuyg");
201 JSHandle<JSTaggedValue> result1Handle(thread, result1);
204 JSHandle<JSTaggedValue> flags(thread->GetEcmaVM()->GetFactory()->NewFromASCII("flags"));
205 JSHandle<JSTaggedValue> flagsResult(JSObject::GetProperty(thread, result1Handle, flags).GetValue());
207 JSHandle<EcmaString> expectResult = thread->GetEcmaVM()->GetFactory()->NewFromASCII("gimuy");
208 ASSERT_EQ(EcmaStringAccessor::Compare(instance, JSHandle<EcmaString>(flagsResult), expectResult), 0);
214 JSHandle<EcmaString> pattern1 = thread->GetEcmaVM()->GetFactory()->NewFromASCII("\\w+");
215 JSHandle<EcmaString> flags1 = thread->GetEcmaVM()->GetFactory()->NewFromASCII("imuyg");
217 JSHandle<JSRegExp> value(thread, reinterpret_cast<JSRegExp *>(result1.GetRawData()));
227 JSHandle<JSTaggedValue> toStringResultHandle(thread, toStringResult);
228 JSHandle<EcmaString> expectResult = thread->GetEcmaVM()->GetFactory()->NewFromASCII("/\\w+/gimuy");
230 JSHandle<EcmaString>(toStringResultHandle), expectResult), 0);
233 void ExecCommon(JSThread* thread, EcmaVM* instance, JSHandle<JSTaggedValue>& execResult,
234 JSHandle<EcmaString>& inputString, std::vector<JSHandle<EcmaString>>& result)
236 JSHandle<JSTaggedValue> input(thread->GetEcmaVM()->GetFactory()->NewFromASCII("input"));
237 JSHandle<JSTaggedValue> inputHandle(JSObject::GetProperty(thread, execResult, input).GetValue());
238 JSHandle<EcmaString> outputInput = JSTaggedValue::ToString(thread, inputHandle);
241 JSHandle<JSTaggedValue> zero(thread->GetEcmaVM()->GetFactory()->NewFromASCII("0"));
242 JSHandle<JSTaggedValue> zeroHandle(JSObject::GetProperty(thread, execResult, zero).GetValue());
243 JSHandle<EcmaString> outputZero = JSTaggedValue::ToString(thread, zeroHandle);
246 JSHandle<JSTaggedValue> first(thread->GetEcmaVM()->GetFactory()->NewFromASCII("1"));
247 JSHandle<JSTaggedValue> oneHandle(JSObject::GetProperty(thread, execResult, first).GetValue());
248 JSHandle<EcmaString> outputOne = JSTaggedValue::ToString(thread, oneHandle);
251 JSHandle<JSTaggedValue> second(thread->GetEcmaVM()->GetFactory()->NewFromASCII("2"));
252 JSHandle<JSTaggedValue> twoHandle(JSObject::GetProperty(thread, execResult, second).GetValue());
253 JSHandle<EcmaString> outputTwo = JSTaggedValue::ToString(thread, twoHandle);
260 JSHandle<EcmaString> pattern1 =
262 JSHandle<EcmaString> flags1 = thread->GetEcmaVM()->GetFactory()->NewFromASCII("ig");
264 JSHandle<JSRegExp> value(thread, reinterpret_cast<JSRegExp *>(result1.GetRawData()));
266 JSHandle<EcmaString> inputString =
277 JSHandle<JSTaggedValue> execResult(thread, results);
278 JSHandle<EcmaString> resultZero =
280 JSHandle<EcmaString> resultOne = thread->GetEcmaVM()->GetFactory()->NewFromASCII("Brown");
281 JSHandle<EcmaString> resultTwo = thread->GetEcmaVM()->GetFactory()->NewFromASCII("Jumps");
283 JSHandle<JSTaggedValue> index(thread->GetEcmaVM()->GetFactory()->NewFromASCII("index"));
284 JSHandle<JSTaggedValue> indexHandle(JSObject::GetProperty(thread, execResult, index).GetValue());
288 std::vector<JSHandle<EcmaString>> result{resultZero, resultOne, resultTwo};
290 JSHandle<JSTaggedValue> regexp = JSHandle<JSTaggedValue>::Cast(value);
291 JSHandle<JSTaggedValue> lastIndexHandle(thread->GetEcmaVM()->GetFactory()->NewFromASCII("lastIndex"));
292 JSHandle<JSTaggedValue> lastIndexObj(JSObject::GetProperty(thread, regexp, lastIndexHandle).GetValue());
300 JSHandle<EcmaString> pattern1 =
302 JSHandle<EcmaString> flags1 = thread->GetEcmaVM()->GetFactory()->NewFromASCII("ig");
304 JSHandle<JSRegExp> value(thread, reinterpret_cast<JSRegExp *>(result1.GetRawData()));
306 JSHandle<EcmaString> inputString = thread->GetEcmaVM()->GetFactory()->NewFromASCII("123");
316 JSHandle<JSTaggedValue> execResult(thread, results);
317 JSHandle<EcmaString> resultZero = thread->GetEcmaVM()->GetFactory()->NewFromASCII("123");
318 JSHandle<EcmaString> resultOne = thread->GetEcmaVM()->GetFactory()->NewFromASCII("1");
319 JSHandle<EcmaString> resultTwo = thread->GetEcmaVM()->GetFactory()->NewFromASCII("1");
320 JSHandle<EcmaString> resultFour = thread->GetEcmaVM()->GetFactory()->NewFromASCII("23");
321 JSHandle<EcmaString> resultSix = thread->GetEcmaVM()->GetFactory()->NewFromASCII("23");
323 JSHandle<JSTaggedValue> index(thread->GetEcmaVM()->GetFactory()->NewFromASCII("index"));
324 JSHandle<JSTaggedValue> indexHandle(JSObject::GetProperty(thread, execResult, index).GetValue());
328 std::vector<JSHandle<EcmaString>> result{resultZero, resultOne, resultTwo};
330 JSHandle<JSTaggedValue> regexp = JSHandle<JSTaggedValue>::Cast(value);
331 JSHandle<JSTaggedValue> lastIndexHandle(thread->GetEcmaVM()->GetFactory()->NewFromASCII("lastIndex"));
332 JSHandle<JSTaggedValue> lastIndexObj(JSObject::GetProperty(thread, regexp, lastIndexHandle).GetValue());
336 JSHandle<JSTaggedValue> third(thread->GetEcmaVM()->GetFactory()->NewFromASCII("3"));
337 JSHandle<JSTaggedValue> thirdHandle(JSObject::GetProperty(thread, execResult, third).GetValue());
340 JSHandle<JSTaggedValue> four(thread->GetEcmaVM()->GetFactory()->NewFromASCII("4"));
341 JSHandle<JSTaggedValue> fourHandle(JSObject::GetProperty(thread, execResult, four).GetValue());
342 JSHandle<EcmaString> outputFour = JSTaggedValue::ToString(thread, fourHandle);
345 JSHandle<JSTaggedValue> five(thread->GetEcmaVM()->GetFactory()->NewFromASCII("5"));
346 JSHandle<JSTaggedValue> fiveHandle(JSObject::GetProperty(thread, execResult, five).GetValue());
349 JSHandle<JSTaggedValue> six(thread->GetEcmaVM()->GetFactory()->NewFromASCII("6"));
350 JSHandle<JSTaggedValue> sixHandle(JSObject::GetProperty(thread, execResult, six).GetValue());
351 JSHandle<EcmaString> outputSix = JSTaggedValue::ToString(thread, sixHandle);
358 JSHandle<EcmaString> pattern1 =
360 JSHandle<EcmaString> flags1 = thread->GetEcmaVM()->GetFactory()->NewFromASCII("iug");
362 JSHandle<JSRegExp> value(thread, reinterpret_cast<JSRegExp *>(result1.GetRawData()));
364 JSHandle<EcmaString> inputString =
373 JSHandle<JSTaggedValue> matchResult(thread, matchResults);
374 JSHandle<JSTaggedValue> zero(thread->GetEcmaVM()->GetFactory()->NewFromASCII("0"));
375 JSHandle<EcmaString> resultZero =
377 JSHandle<JSTaggedValue> zeroHandle(JSObject::GetProperty(thread, matchResult, zero).GetValue());
378 JSHandle<EcmaString> outputZero = JSTaggedValue::ToString(thread, zeroHandle);
385 JSHandle<EcmaString> pattern1 =
387 JSHandle<EcmaString> flags1 = thread->GetEcmaVM()->GetFactory()->NewFromASCII("iug");
389 JSHandle<JSRegExp> value(thread, reinterpret_cast<JSRegExp *>(result1.GetRawData()));
391 JSHandle<EcmaString> inputString =
405 JSHandle<EcmaString> pattern1 =
407 JSHandle<EcmaString> flags1 = thread->GetEcmaVM()->GetFactory()->NewFromASCII("iug");
409 JSHandle<JSRegExp> value(thread, reinterpret_cast<JSRegExp *>(result1.GetRawData()));
411 JSHandle<EcmaString> inputString =
425 JSHandle<EcmaString> pattern1 = thread->GetEcmaVM()->GetFactory()->NewFromASCII("-");
426 JSHandle<EcmaString> flags1 = thread->GetEcmaVM()->GetFactory()->NewFromASCII("iug");
428 JSHandle<JSRegExp> value(thread, reinterpret_cast<JSRegExp *>(result1.GetRawData()));
430 JSHandle<EcmaString> inputString = thread->GetEcmaVM()->GetFactory()->NewFromASCII("");
441 JSHandle<JSTaggedValue> splitResult(thread, splitResults);
443 JSHandle<JSTaggedValue> zero(thread->GetEcmaVM()->GetFactory()->NewFromASCII("0"));
444 JSHandle<JSTaggedValue> zeroHandle(JSObject::GetProperty(thread, splitResult, zero).GetValue());
445 JSHandle<EcmaString> outputZero = JSTaggedValue::ToString(thread, zeroHandle);
453 JSHandle<EcmaString> pattern1 = thread->GetEcmaVM()->GetFactory()->NewFromASCII("-");
454 JSHandle<EcmaString> flags1 = thread->GetEcmaVM()->GetFactory()->NewFromASCII("iug");
456 JSHandle<JSRegExp> value(thread, reinterpret_cast<JSRegExp *>(result1.GetRawData()));
458 JSHandle<EcmaString> inputString = thread->GetEcmaVM()->GetFactory()->NewFromASCII("a-b-c");
469 JSHandle<JSTaggedValue> splitResult(thread, splitResults);
470 JSHandle<EcmaString> resultZero = thread->GetEcmaVM()->GetFactory()->NewFromASCII("a");
471 JSHandle<EcmaString> resultOne = thread->GetEcmaVM()->GetFactory()->NewFromASCII("b");
472 JSHandle<EcmaString> resultTwo = thread->GetEcmaVM()->GetFactory()->NewFromASCII("c");
474 JSHandle<JSTaggedValue> zero(thread->GetEcmaVM()->GetFactory()->NewFromASCII("0"));
475 JSHandle<JSTaggedValue> zeroHandle(JSObject::GetProperty(thread, splitResult, zero).GetValue());
476 JSHandle<EcmaString> outputZero = JSTaggedValue::ToString(thread, zeroHandle);
479 JSHandle<JSTaggedValue> first(thread->GetEcmaVM()->GetFactory()->NewFromASCII("1"));
480 JSHandle<JSTaggedValue> oneHandle(JSObject::GetProperty(thread, splitResult, first).GetValue());
481 JSHandle<EcmaString> outputOne = JSTaggedValue::ToString(thread, oneHandle);
484 JSHandle<JSTaggedValue> second(thread->GetEcmaVM()->GetFactory()->NewFromASCII("2"));
485 JSHandle<JSTaggedValue> twoHandle(JSObject::GetProperty(thread, splitResult, second).GetValue());
486 JSHandle<EcmaString> outputTwo = JSTaggedValue::ToString(thread, twoHandle);
493 JSHandle<GlobalEnv> env = thread->GetEcmaVM()->GetGlobalEnv();
494 JSHandle<JSTaggedValue> speciesSymbol = env->GetSpeciesSymbol();
497 JSHandle<JSFunction> newTarget(env->GetRegExpFunction());
500 JSObject::GetProperty(thread, JSHandle<JSTaggedValue>(newTarget), speciesSymbol).GetValue().GetTaggedValue();
507 JSHandle<EcmaString> pattern1 =
509 JSHandle<EcmaString> flags1 = thread->GetEcmaVM()->GetFactory()->NewFromASCII("iug");
511 JSHandle<JSRegExp> value(thread, reinterpret_cast<JSRegExp *>(result1.GetRawData()));
513 JSHandle<EcmaString> inputString =
515 JSHandle<EcmaString> replaceString =
526 JSHandle<JSTaggedValue> replaceResult(thread, results);
527 JSHandle<EcmaString> resultZero = thread->GetEcmaVM()->GetFactory()->NewFromASCII(
529 ASSERT_EQ(EcmaStringAccessor::Compare(instance, JSHandle<EcmaString>(replaceResult), resultZero), 0);
536 JSHandle<EcmaString> pattern1 = factory->NewFromASCII("b(c)(z)?(.)");
537 JSHandle<EcmaString> flags1 = factory->NewFromASCII("");
539 JSHandle<JSRegExp> value(thread, reinterpret_cast<JSRegExp *>(result1.GetRawData()));
541 JSHandle<EcmaString> inputString = factory->NewFromASCII("abcde");
542 JSHandle<EcmaString> replaceString = factory->NewFromASCII("[$01$02$03$04$00]");
552 JSHandle<JSTaggedValue> replaceResult(thread, results);
553 JSHandle<EcmaString> resultZero = factory->NewFromASCII("a[cd$04$00]e");
554 ASSERT_EQ(EcmaStringAccessor::Compare(instance, JSHandle<EcmaString>(replaceResult), resultZero), 0);
561 JSHandle<EcmaString> pattern1 = factory->NewFromASCII("abc");
562 JSHandle<EcmaString> flags1 = factory->NewFromASCII("g");
564 JSHandle<JSRegExp> value(thread, reinterpret_cast<JSRegExp *>(result1.GetRawData()));
566 JSHandle<EcmaString> inputString = factory->NewFromASCII("abcde");
567 JSHandle<EcmaString> replaceString = factory->NewFromASCII("");
577 JSHandle<JSTaggedValue> replaceResult(thread, results);
578 JSHandle<EcmaString> resultZero = factory->NewFromASCII("de");
579 ASSERT_EQ(EcmaStringAccessor::Compare(instance, JSHandle<EcmaString>(replaceResult), resultZero), 0);
586 JSHandle<EcmaString> string1 = factory->NewFromASCII("abc");
587 JSHandle<EcmaString> string2 = factory->NewFromASCII("abcd");
602 JSHandle<EcmaString> pattern1 = factory->NewFromASCII("(?<groupname>a)");
603 JSHandle<EcmaString> flags1 = factory->NewFromASCII("gd");
605 JSHandle<JSTaggedValue> result1Handle(thread, result1);
608 JSHandle<JSTaggedValue> flags(factory->NewFromASCII("flags"));
609 JSHandle<JSTaggedValue> flagsResult(JSObject::GetProperty(thread, result1Handle, flags).GetValue());
610 JSHandle<EcmaString> expectResult = factory->NewFromASCII("dg");
611 ASSERT_EQ(EcmaStringAccessor::Compare(instance, JSHandle<EcmaString>(flagsResult), expectResult), 0);
614 JSHandle<JSTaggedValue> hasIndices(factory->NewFromASCII("hasIndices"));
619 JSHandle<EcmaString> inputString = factory->NewFromASCII("babcae");
631 JSHandle<JSTaggedValue> execResult(thread, results);
632 JSHandle<JSTaggedValue> indices(factory->NewFromASCII("indices"));
633 JSHandle<JSTaggedValue> indicesArr = JSObject::GetProperty(thread, execResult, indices).GetValue();
636 JSHandle<JSTaggedValue> indices0 = JSObject::GetProperty(thread, indicesArr, 0).GetValue();
641 JSHandle<JSTaggedValue> indices1 = JSObject::GetProperty(thread, indicesArr, 1).GetValue();
647 JSHandle<JSTaggedValue> groups(factory->NewFromASCII("groups"));
648 JSHandle<JSTaggedValue> groupsObj = JSObject::GetProperty(thread, indicesArr, groups).GetValue();
650 JSHandle<JSTaggedValue> groupName(factory->NewFromASCII("groupname"));
651 JSHandle<JSTaggedValue> groupNameArr = JSObject::GetProperty(thread, groupsObj, groupName).GetValue();