diff --git a/test/built-ins/RegExp/prototype/Symbol.matchAll/isregexp-called-once.js b/test/built-ins/RegExp/prototype/Symbol.matchAll/isregexp-called-once.js index 7281af422f55ecccb215cdfebae7e7a7795fac69..c3b3e173b359cba8b277e5634a074640b00d35e1 100644 --- a/test/built-ins/RegExp/prototype/Symbol.matchAll/isregexp-called-once.js +++ b/test/built-ins/RegExp/prototype/Symbol.matchAll/isregexp-called-once.js @@ -25,16 +25,32 @@ Object.defineProperty(RegExp.prototype, Symbol.match, { } }); -var count = 0; +var calls = []; var o = { get [Symbol.match]() { - ++count; + calls.push('get @@match'); return false; }, - flags: "", + get flags() { + calls.push('get flags'); + return { + toString() { + calls.push('flags toString'); + } + }; + }, }; -RegExp.prototype[Symbol.matchAll].call(o, '1'); +RegExp.prototype[Symbol.matchAll].call(o, { + toString() { + calls.push('arg toString') + } +}); assert.sameValue(0, internalCount); -assert.sameValue(1, count); + +assert.sameValue(calls.length, 4); +assert.sameValue(calls[0], 'get @@match'); +assert.sameValue(calls[1], 'arg toString'); +assert.sameValue(calls[2], 'get flags'); +assert.sameValue(calls[3], 'flags toString');