Implement the @@match well-known Symbol (#157)

Signed-off-by: Bela Toth tbela@inf.u-szeged.hu
This commit is contained in:
Tóth Béla 2019-10-11 07:46:27 +02:00 committed by Hyukwoo Park
commit 44e90a6b91
8 changed files with 90 additions and 29 deletions

View file

@ -1558,4 +1558,13 @@ String* Object::optionString(ExecutionState& state)
return new ASCIIString(flags);
}
bool Object::isRegExp(ExecutionState& state)
{
Value symbol = get(state, ObjectPropertyName(state, state.context()->vmInstance()->globalSymbols().match)).value(state, this);
if (!symbol.isUndefined()) {
return symbol.toBoolean(state);
}
return isRegExpObject();
}
}