mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 457130 - TM: regexp lastIndex property not traced correctly (r=danderson).
This commit is contained in:
parent
3808521295
commit
8030ce9609
@ -5317,6 +5317,8 @@ TraceRecorder::prop(JSObject* obj, LIns* obj_ins, uint32& slot, LIns*& v_ins)
|
||||
if (setflags == 0 &&
|
||||
sprop->getter == js_RegExpClass.getProperty &&
|
||||
sprop->shortid < 0) {
|
||||
if (sprop->shortid == REGEXP_LAST_INDEX)
|
||||
ABORT_TRACE("can't trace regexp.lastIndex yet");
|
||||
LIns* args[] = { INS_CONSTPTR(sprop), obj_ins, cx_ins };
|
||||
v_ins = lir->insCall(F_CallGetter, args);
|
||||
guard(false, lir->ins2(LIR_eq, v_ins, INS_CONST(JSVAL_ERROR_COOKIE)), OOM_EXIT);
|
||||
|
@ -1626,6 +1626,21 @@ function testInnerMissingArgs()
|
||||
testInnerMissingArgs.expected = 1; //Expected: that we don't crash.
|
||||
test(testInnerMissingArgs);
|
||||
|
||||
function regexpLastIndex()
|
||||
{
|
||||
var n = 0;
|
||||
var re = /hi/g;
|
||||
var ss = " hi hi hi hi hi hi hi hi hi hi";
|
||||
for (var i = 0; i < 10; i++) {
|
||||
// re.exec(ss);
|
||||
n += (re.lastIndex > 0) ? 3 : 0;
|
||||
re.lastIndex = 0;
|
||||
}
|
||||
return n;
|
||||
}
|
||||
regexpLastIndex.expected = 0; // 30;
|
||||
test(regexpLastIndex);
|
||||
|
||||
/* Keep these at the end so that we can see the summary after the trace-debug spew. */
|
||||
print("\npassed:", passes.length && passes.join(","));
|
||||
print("\nFAILED:", fails.length && fails.join(","));
|
||||
|
Loading…
Reference in New Issue
Block a user