mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-16 14:55:47 +00:00
Bug 1050340 - Access regexp guts generically. r=luke
This commit is contained in:
parent
649e683260
commit
96b7d14308
@ -1011,10 +1011,12 @@ JSStructuredCloneWriter::startWrite(HandleValue v)
|
||||
if (backref)
|
||||
return true;
|
||||
|
||||
if (obj->is<RegExpObject>()) {
|
||||
RegExpObject &reobj = obj->as<RegExpObject>();
|
||||
return out.writePair(SCTAG_REGEXP_OBJECT, reobj.getFlags()) &&
|
||||
writeString(SCTAG_STRING, reobj.getSource());
|
||||
if (ObjectClassIs(obj, ESClass_RegExp, context())) {
|
||||
RegExpGuard re(context());
|
||||
if (!RegExpToShared(context(), obj, &re))
|
||||
return false;
|
||||
return out.writePair(SCTAG_REGEXP_OBJECT, re->getFlags()) &&
|
||||
writeString(SCTAG_STRING, re->getSource());
|
||||
} else if (obj->is<DateObject>()) {
|
||||
double d = js_DateGetMsecSinceEpoch(obj);
|
||||
return out.writePair(SCTAG_DATE_OBJECT, 0) && out.writeDouble(d);
|
||||
|
Loading…
Reference in New Issue
Block a user