2009-06-10 18:29:44 -07:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
2007-03-22 10:30:00 -07:00
|
|
|
*
|
|
|
|
* ***** BEGIN LICENSE BLOCK *****
|
|
|
|
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
|
|
|
*
|
|
|
|
* The contents of this file are subject to the Mozilla Public License Version
|
|
|
|
* 1.1 (the "License"); you may not use this file except in compliance with
|
|
|
|
* the License. You may obtain a copy of the License at
|
|
|
|
* http://www.mozilla.org/MPL/
|
|
|
|
*
|
|
|
|
* Software distributed under the License is distributed on an "AS IS" basis,
|
|
|
|
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
|
|
|
* for the specific language governing rights and limitations under the
|
|
|
|
* License.
|
|
|
|
*
|
|
|
|
* The Original Code is Mozilla Communicator client code, released
|
|
|
|
* March 31, 1998.
|
|
|
|
*
|
|
|
|
* The Initial Developer of the Original Code is
|
|
|
|
* Netscape Communications Corporation.
|
|
|
|
* Portions created by the Initial Developer are Copyright (C) 1998
|
|
|
|
* the Initial Developer. All Rights Reserved.
|
|
|
|
*
|
|
|
|
* Contributor(s):
|
|
|
|
*
|
|
|
|
* Alternatively, the contents of this file may be used under the terms of
|
|
|
|
* either of the GNU General Public License Version 2 or later (the "GPL"),
|
|
|
|
* or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
|
|
|
* in which case the provisions of the GPL or the LGPL are applicable instead
|
|
|
|
* of those above. If you wish to allow use of your version of this file only
|
|
|
|
* under the terms of either the GPL or the LGPL, and not to allow others to
|
|
|
|
* use your version of this file under the terms of the MPL, indicate your
|
|
|
|
* decision by deleting the provisions above and replace them with the notice
|
|
|
|
* and other provisions required by the GPL or the LGPL. If you do not delete
|
|
|
|
* the provisions above, a recipient may use your version of this file under
|
|
|
|
* the terms of any one of the MPL, the GPL or the LGPL.
|
|
|
|
*
|
|
|
|
* ***** END LICENSE BLOCK ***** */
|
|
|
|
|
|
|
|
#ifndef jsregexp_h___
|
|
|
|
#define jsregexp_h___
|
|
|
|
/*
|
|
|
|
* JS regular expression interface.
|
|
|
|
*/
|
|
|
|
#include <stddef.h>
|
2010-08-11 13:30:07 -07:00
|
|
|
#include "jsprvtd.h"
|
2007-03-22 10:30:00 -07:00
|
|
|
#include "jsstr.h"
|
2010-09-13 15:53:50 -07:00
|
|
|
#include "jscntxt.h"
|
|
|
|
#include "jsvector.h"
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
#ifdef JS_THREADSAFE
|
|
|
|
#include "jsdhash.h"
|
|
|
|
#endif
|
|
|
|
|
2010-08-11 13:30:07 -07:00
|
|
|
extern js::Class js_RegExpClass;
|
|
|
|
|
2010-09-13 15:53:50 -07:00
|
|
|
namespace js {
|
|
|
|
|
|
|
|
class RegExpStatics
|
|
|
|
{
|
|
|
|
typedef Vector<int, 20, SystemAllocPolicy> MatchPairs;
|
2010-11-10 17:02:08 -08:00
|
|
|
MatchPairs matchPairs;
|
|
|
|
/* The input that was used to produce matchPairs. */
|
2010-12-06 10:26:58 -08:00
|
|
|
JSLinearString *matchPairsInput;
|
2010-11-10 17:02:08 -08:00
|
|
|
/* The input last set on the statics. */
|
|
|
|
JSString *pendingInput;
|
|
|
|
uintN flags;
|
|
|
|
RegExpStatics *bufferLink;
|
|
|
|
bool copied;
|
2010-09-13 15:53:50 -07:00
|
|
|
|
|
|
|
bool createDependent(JSContext *cx, size_t start, size_t end, Value *out) const;
|
|
|
|
|
2010-10-04 11:45:34 -07:00
|
|
|
void copyTo(RegExpStatics &dst) {
|
|
|
|
dst.matchPairs.clear();
|
|
|
|
/* 'save' has already reserved space in matchPairs */
|
2011-02-18 18:32:29 -08:00
|
|
|
dst.matchPairs.infallibleAppend(matchPairs);
|
2010-11-10 17:02:08 -08:00
|
|
|
dst.matchPairsInput = matchPairsInput;
|
|
|
|
dst.pendingInput = pendingInput;
|
2010-10-04 11:45:34 -07:00
|
|
|
dst.flags = flags;
|
|
|
|
}
|
|
|
|
|
|
|
|
void aboutToWrite() {
|
|
|
|
if (bufferLink && !bufferLink->copied) {
|
|
|
|
copyTo(*bufferLink);
|
|
|
|
bufferLink->copied = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-11-10 17:02:08 -08:00
|
|
|
bool save(JSContext *cx, RegExpStatics *buffer) {
|
|
|
|
JS_ASSERT(!buffer->copied && !buffer->bufferLink);
|
|
|
|
buffer->bufferLink = bufferLink;
|
|
|
|
bufferLink = buffer;
|
|
|
|
if (!buffer->matchPairs.reserve(matchPairs.length())) {
|
|
|
|
js_ReportOutOfMemory(cx);
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
void restore() {
|
|
|
|
if (bufferLink->copied)
|
|
|
|
bufferLink->copyTo(*this);
|
|
|
|
bufferLink = bufferLink->bufferLink;
|
|
|
|
}
|
|
|
|
|
|
|
|
void checkInvariants() {
|
|
|
|
#if DEBUG
|
|
|
|
if (pairCount() == 0) {
|
|
|
|
JS_ASSERT(!matchPairsInput);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Pair count is non-zero, so there must be match pairs input. */
|
|
|
|
JS_ASSERT(matchPairsInput);
|
|
|
|
size_t mpiLen = matchPairsInput->length();
|
|
|
|
|
2010-12-01 16:33:49 -08:00
|
|
|
/* Both members of the first pair must be non-negative. */
|
2010-11-10 17:02:08 -08:00
|
|
|
JS_ASSERT(pairIsPresent(0));
|
2010-12-01 16:33:49 -08:00
|
|
|
JS_ASSERT(get(0, 1) >= 0);
|
2010-11-10 17:02:08 -08:00
|
|
|
|
|
|
|
/* Present pairs must be valid. */
|
|
|
|
for (size_t i = 0; i < pairCount(); ++i) {
|
|
|
|
if (!pairIsPresent(i))
|
|
|
|
continue;
|
|
|
|
int start = get(i, 0);
|
|
|
|
int limit = get(i, 1);
|
|
|
|
JS_ASSERT(mpiLen >= size_t(limit) && limit >= start && start >= 0);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
2010-12-01 16:34:10 -08:00
|
|
|
/*
|
|
|
|
* Since the first pair indicates the whole match, the paren pair numbers have to be in the
|
|
|
|
* range [1, pairCount).
|
|
|
|
*/
|
|
|
|
void checkParenNum(size_t pairNum) const {
|
2010-12-06 13:12:58 -08:00
|
|
|
JS_ASSERT(1 <= pairNum);
|
|
|
|
JS_ASSERT(pairNum < pairCount());
|
2010-12-01 16:34:10 -08:00
|
|
|
}
|
|
|
|
|
2010-12-01 16:33:49 -08:00
|
|
|
/* Precondition: paren is present. */
|
2010-12-01 16:34:10 -08:00
|
|
|
size_t getParenLength(size_t pairNum) const {
|
|
|
|
checkParenNum(pairNum);
|
2010-12-06 13:12:58 -08:00
|
|
|
JS_ASSERT(pairIsPresent(pairNum));
|
|
|
|
return get(pairNum, 1) - get(pairNum, 0);
|
2010-12-01 16:33:49 -08:00
|
|
|
}
|
|
|
|
|
2010-11-10 17:02:08 -08:00
|
|
|
int get(size_t pairNum, bool which) const {
|
|
|
|
JS_ASSERT(pairNum < pairCount());
|
|
|
|
return matchPairs[2 * pairNum + which];
|
|
|
|
}
|
|
|
|
|
2010-09-13 15:53:50 -07:00
|
|
|
/*
|
|
|
|
* Check whether the index at |checkValidIndex| is valid (>= 0).
|
|
|
|
* If so, construct a string for it and place it in |*out|.
|
|
|
|
* If not, place undefined in |*out|.
|
|
|
|
*/
|
|
|
|
bool makeMatch(JSContext *cx, size_t checkValidIndex, size_t pairNum, Value *out) const;
|
2010-11-10 17:02:08 -08:00
|
|
|
|
2010-11-10 17:02:08 -08:00
|
|
|
static const uintN allFlags = JSREG_FOLD | JSREG_GLOB | JSREG_STICKY | JSREG_MULTILINE;
|
2010-11-10 17:02:08 -08:00
|
|
|
|
2010-11-15 20:15:02 -08:00
|
|
|
struct InitBuffer {};
|
|
|
|
explicit RegExpStatics(InitBuffer) : bufferLink(NULL), copied(false) {}
|
|
|
|
|
2010-11-10 17:02:08 -08:00
|
|
|
friend class PreserveRegExpStatics;
|
|
|
|
|
|
|
|
public:
|
|
|
|
RegExpStatics() : bufferLink(NULL), copied(false) { clear(); }
|
|
|
|
|
2011-04-21 13:29:54 -07:00
|
|
|
static RegExpStatics *extractFrom(JSObject *global);
|
2010-09-13 15:53:50 -07:00
|
|
|
|
|
|
|
/* Mutators. */
|
|
|
|
|
2010-12-06 10:26:58 -08:00
|
|
|
bool updateFromMatch(JSContext *cx, JSLinearString *input, int *buf, size_t matchItemCount) {
|
2010-11-10 17:02:08 -08:00
|
|
|
aboutToWrite();
|
|
|
|
pendingInput = input;
|
|
|
|
|
|
|
|
if (!matchPairs.resizeUninitialized(matchItemCount)) {
|
2010-10-04 11:45:34 -07:00
|
|
|
js_ReportOutOfMemory(cx);
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2010-11-10 17:02:08 -08:00
|
|
|
for (size_t i = 0; i < matchItemCount; ++i)
|
|
|
|
matchPairs[i] = buf[i];
|
|
|
|
|
|
|
|
matchPairsInput = input;
|
|
|
|
return true;
|
2010-11-15 20:15:02 -08:00
|
|
|
}
|
|
|
|
|
2010-09-13 15:53:50 -07:00
|
|
|
void setMultiline(bool enabled) {
|
2010-10-04 11:45:34 -07:00
|
|
|
aboutToWrite();
|
2010-09-13 15:53:50 -07:00
|
|
|
if (enabled)
|
|
|
|
flags = flags | JSREG_MULTILINE;
|
|
|
|
else
|
|
|
|
flags = flags & ~JSREG_MULTILINE;
|
|
|
|
}
|
|
|
|
|
|
|
|
void clear() {
|
2010-10-04 11:45:34 -07:00
|
|
|
aboutToWrite();
|
2010-09-13 15:53:50 -07:00
|
|
|
flags = 0;
|
2010-11-10 17:02:08 -08:00
|
|
|
pendingInput = NULL;
|
|
|
|
matchPairsInput = NULL;
|
2010-09-13 15:53:50 -07:00
|
|
|
matchPairs.clear();
|
|
|
|
}
|
|
|
|
|
2010-11-10 17:02:08 -08:00
|
|
|
/* Corresponds to JSAPI functionality to set the pending RegExp input. */
|
2010-09-13 15:53:50 -07:00
|
|
|
void reset(JSString *newInput, bool newMultiline) {
|
2010-10-04 11:45:34 -07:00
|
|
|
aboutToWrite();
|
2010-09-13 15:53:50 -07:00
|
|
|
clear();
|
2010-11-10 17:02:08 -08:00
|
|
|
pendingInput = newInput;
|
2010-09-13 15:53:50 -07:00
|
|
|
setMultiline(newMultiline);
|
|
|
|
checkInvariants();
|
|
|
|
}
|
|
|
|
|
2010-11-10 17:02:08 -08:00
|
|
|
void setPendingInput(JSString *newInput) {
|
2010-10-04 11:45:34 -07:00
|
|
|
aboutToWrite();
|
2010-11-10 17:02:08 -08:00
|
|
|
pendingInput = newInput;
|
2010-09-13 15:53:50 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Accessors. */
|
|
|
|
|
2010-12-01 16:34:10 -08:00
|
|
|
/*
|
|
|
|
* When there is a match present, the pairCount is at least 1 for the whole
|
|
|
|
* match. There is one additional pair per parenthesis.
|
|
|
|
*
|
|
|
|
* Getting a parenCount requires there to be a match result as a precondition.
|
|
|
|
*/
|
|
|
|
|
|
|
|
private:
|
|
|
|
size_t pairCount() const {
|
|
|
|
JS_ASSERT(matchPairs.length() % 2 == 0);
|
|
|
|
return matchPairs.length() / 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
public:
|
|
|
|
size_t parenCount() const {
|
|
|
|
size_t pc = pairCount();
|
2010-12-06 13:12:58 -08:00
|
|
|
JS_ASSERT(pc);
|
2010-12-01 16:34:10 -08:00
|
|
|
return pc - 1;
|
|
|
|
}
|
|
|
|
|
2010-11-10 17:02:08 -08:00
|
|
|
JSString *getPendingInput() const { return pendingInput; }
|
2010-09-13 15:53:50 -07:00
|
|
|
uintN getFlags() const { return flags; }
|
|
|
|
bool multiline() const { return flags & JSREG_MULTILINE; }
|
2010-11-10 17:02:08 -08:00
|
|
|
|
|
|
|
size_t matchStart() const {
|
|
|
|
int start = get(0, 0);
|
|
|
|
JS_ASSERT(start >= 0);
|
|
|
|
return size_t(start);
|
|
|
|
}
|
|
|
|
|
|
|
|
size_t matchLimit() const {
|
|
|
|
int limit = get(0, 1);
|
|
|
|
JS_ASSERT(size_t(limit) >= matchStart() && limit >= 0);
|
|
|
|
return size_t(limit);
|
|
|
|
}
|
|
|
|
|
2010-12-01 16:33:49 -08:00
|
|
|
/* Returns whether results for a non-empty match are present. */
|
2010-11-10 17:02:08 -08:00
|
|
|
bool matched() const {
|
|
|
|
JS_ASSERT(pairCount() > 0);
|
2010-12-01 16:33:49 -08:00
|
|
|
JS_ASSERT_IF(get(0, 1) == -1, get(1, 1) == -1);
|
2010-11-10 17:02:08 -08:00
|
|
|
return get(0, 1) - get(0, 0) > 0;
|
|
|
|
}
|
|
|
|
|
2010-09-13 15:53:50 -07:00
|
|
|
void mark(JSTracer *trc) const {
|
2010-11-10 17:02:08 -08:00
|
|
|
if (pendingInput)
|
|
|
|
JS_CALL_STRING_TRACER(trc, pendingInput, "res->pendingInput");
|
|
|
|
if (matchPairsInput)
|
|
|
|
JS_CALL_STRING_TRACER(trc, matchPairsInput, "res->matchPairsInput");
|
2010-09-13 15:53:50 -07:00
|
|
|
}
|
|
|
|
|
2011-03-09 21:04:47 -08:00
|
|
|
bool pairIsPresent(size_t pairNum) const {
|
|
|
|
return get(pairNum, 0) >= 0;
|
|
|
|
}
|
|
|
|
|
2010-09-13 15:53:50 -07:00
|
|
|
/* Value creators. */
|
|
|
|
|
2010-11-10 17:02:08 -08:00
|
|
|
bool createPendingInput(JSContext *cx, Value *out) const;
|
2010-09-13 15:53:50 -07:00
|
|
|
bool createLastMatch(JSContext *cx, Value *out) const { return makeMatch(cx, 0, 0, out); }
|
|
|
|
bool createLastParen(JSContext *cx, Value *out) const;
|
|
|
|
bool createLeftContext(JSContext *cx, Value *out) const;
|
|
|
|
bool createRightContext(JSContext *cx, Value *out) const;
|
|
|
|
|
2010-12-01 16:34:10 -08:00
|
|
|
/* @param pairNum Any number >= 1. */
|
|
|
|
bool createParen(JSContext *cx, size_t pairNum, Value *out) const {
|
2010-12-06 13:12:58 -08:00
|
|
|
JS_ASSERT(pairNum >= 1);
|
2010-12-01 16:34:10 -08:00
|
|
|
if (pairNum >= pairCount()) {
|
|
|
|
out->setString(cx->runtime->emptyString);
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
return makeMatch(cx, pairNum * 2, pairNum, out);
|
2010-09-13 15:53:50 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Substring creators. */
|
|
|
|
|
2010-12-01 16:34:10 -08:00
|
|
|
void getParen(size_t pairNum, JSSubString *out) const;
|
2010-09-13 15:53:50 -07:00
|
|
|
void getLastMatch(JSSubString *out) const;
|
|
|
|
void getLastParen(JSSubString *out) const;
|
|
|
|
void getLeftContext(JSSubString *out) const;
|
|
|
|
void getRightContext(JSSubString *out) const;
|
|
|
|
};
|
|
|
|
|
2010-11-10 17:02:08 -08:00
|
|
|
class PreserveRegExpStatics
|
|
|
|
{
|
|
|
|
RegExpStatics *const original;
|
|
|
|
RegExpStatics buffer;
|
|
|
|
|
|
|
|
public:
|
|
|
|
explicit PreserveRegExpStatics(RegExpStatics *original)
|
|
|
|
: original(original),
|
|
|
|
buffer(RegExpStatics::InitBuffer())
|
|
|
|
{}
|
|
|
|
|
|
|
|
bool init(JSContext *cx) {
|
|
|
|
return original->save(cx, &buffer);
|
|
|
|
}
|
|
|
|
|
|
|
|
~PreserveRegExpStatics() {
|
|
|
|
original->restore();
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2010-09-13 15:53:50 -07:00
|
|
|
}
|
|
|
|
|
2010-08-11 13:30:07 -07:00
|
|
|
static inline bool
|
|
|
|
VALUE_IS_REGEXP(JSContext *cx, js::Value v)
|
|
|
|
{
|
|
|
|
return !v.isPrimitive() && v.toObject().isRegExp();
|
|
|
|
}
|
|
|
|
|
2010-07-12 13:40:44 -07:00
|
|
|
inline const js::Value &
|
|
|
|
JSObject::getRegExpLastIndex() const
|
|
|
|
{
|
|
|
|
JS_ASSERT(isRegExp());
|
2010-10-13 11:49:22 -07:00
|
|
|
return getSlot(JSSLOT_REGEXP_LAST_INDEX);
|
2010-07-12 13:40:44 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
inline void
|
|
|
|
JSObject::setRegExpLastIndex(const js::Value &v)
|
|
|
|
{
|
|
|
|
JS_ASSERT(isRegExp());
|
2010-10-13 11:49:22 -07:00
|
|
|
setSlot(JSSLOT_REGEXP_LAST_INDEX, v);
|
2010-07-12 13:40:44 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
inline void
|
|
|
|
JSObject::setRegExpLastIndex(jsdouble d)
|
|
|
|
{
|
|
|
|
JS_ASSERT(isRegExp());
|
2010-10-13 11:49:22 -07:00
|
|
|
setSlot(JSSLOT_REGEXP_LAST_INDEX, js::NumberValue(d));
|
2010-07-12 13:40:44 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
inline void
|
|
|
|
JSObject::zeroRegExpLastIndex()
|
|
|
|
{
|
|
|
|
JS_ASSERT(isRegExp());
|
2011-03-05 15:29:30 -08:00
|
|
|
setSlot(JSSLOT_REGEXP_LAST_INDEX, js::Int32Value(0));
|
|
|
|
}
|
|
|
|
|
|
|
|
inline void
|
|
|
|
JSObject::setRegExpSource(JSString *source)
|
|
|
|
{
|
|
|
|
setSlot(JSSLOT_REGEXP_SOURCE, js::StringValue(source));
|
|
|
|
}
|
|
|
|
|
|
|
|
inline void
|
|
|
|
JSObject::setRegExpGlobal(bool global)
|
|
|
|
{
|
|
|
|
setSlot(JSSLOT_REGEXP_GLOBAL, js::BooleanValue(global));
|
|
|
|
}
|
|
|
|
|
|
|
|
inline void
|
|
|
|
JSObject::setRegExpIgnoreCase(bool ignoreCase)
|
|
|
|
{
|
|
|
|
setSlot(JSSLOT_REGEXP_IGNORE_CASE, js::BooleanValue(ignoreCase));
|
|
|
|
}
|
|
|
|
|
|
|
|
inline void
|
|
|
|
JSObject::setRegExpMultiline(bool multiline)
|
|
|
|
{
|
|
|
|
setSlot(JSSLOT_REGEXP_MULTILINE, js::BooleanValue(multiline));
|
|
|
|
}
|
|
|
|
|
|
|
|
inline void
|
|
|
|
JSObject::setRegExpSticky(bool sticky)
|
|
|
|
{
|
|
|
|
setSlot(JSSLOT_REGEXP_STICKY, js::BooleanValue(sticky));
|
2010-07-12 13:40:44 -07:00
|
|
|
}
|
|
|
|
|
2010-07-14 23:19:36 -07:00
|
|
|
namespace js { class AutoStringRooter; }
|
2010-03-29 12:24:03 -07:00
|
|
|
|
2009-12-30 13:49:26 -08:00
|
|
|
inline bool
|
|
|
|
JSObject::isRegExp() const
|
|
|
|
{
|
|
|
|
return getClass() == &js_RegExpClass;
|
|
|
|
}
|
|
|
|
|
2010-03-17 12:55:45 -07:00
|
|
|
extern JS_FRIEND_API(JSBool)
|
|
|
|
js_ObjectIsRegExp(JSObject *obj);
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
extern JSObject *
|
|
|
|
js_InitRegExpClass(JSContext *cx, JSObject *obj);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Export js_regexp_toString to the decompiler.
|
|
|
|
*/
|
|
|
|
extern JSBool
|
2010-07-14 23:19:36 -07:00
|
|
|
js_regexp_toString(JSContext *cx, JSObject *obj, js::Value *vp);
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2010-08-11 13:30:07 -07:00
|
|
|
extern JS_FRIEND_API(JSObject *) JS_FASTCALL
|
|
|
|
js_CloneRegExpObject(JSContext *cx, JSObject *obj, JSObject *proto);
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
/*
|
2010-08-11 13:30:07 -07:00
|
|
|
* Move data from |cx|'s regexp statics to |statics| and root the input string in |tvr| if it's
|
|
|
|
* available.
|
2007-03-22 10:30:00 -07:00
|
|
|
*/
|
2010-08-11 13:30:07 -07:00
|
|
|
extern JS_FRIEND_API(void)
|
|
|
|
js_SaveAndClearRegExpStatics(JSContext *cx, js::RegExpStatics *res, js::AutoStringRooter *tvr);
|
|
|
|
|
|
|
|
/* Move the data from |statics| into |cx|. */
|
|
|
|
extern JS_FRIEND_API(void)
|
|
|
|
js_RestoreRegExpStatics(JSContext *cx, js::RegExpStatics *res);
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
extern JSBool
|
2009-05-06 16:03:10 -07:00
|
|
|
js_XDRRegExpObject(JSXDRState *xdr, JSObject **objp);
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2010-09-01 16:39:56 -07:00
|
|
|
extern JSBool
|
|
|
|
js_regexp_exec(JSContext *cx, uintN argc, js::Value *vp);
|
|
|
|
extern JSBool
|
|
|
|
js_regexp_test(JSContext *cx, uintN argc, js::Value *vp);
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
#endif /* jsregexp_h___ */
|