diff --git a/mozilla/js2/src/bytecodecontainer.cpp b/mozilla/js2/src/bytecodecontainer.cpp
index 0c82f2caf28..323cc952de3 100644
--- a/mozilla/js2/src/bytecodecontainer.cpp
+++ b/mozilla/js2/src/bytecodecontainer.cpp
@@ -155,6 +155,9 @@ namespace MetaData {
for (std::vector::iterator fi = mFrameList.begin(), fend = mFrameList.end(); (fi != fend); fi++) {
GCMARKOBJECT(*fi);
}
+ for (std::vector::iterator ri = mRegExpList.begin(), rend = mRegExpList.end(); (ri != rend); ri++) {
+ GCMARKOBJECT(*ri);
+ }
}
}
diff --git a/mozilla/js2/src/bytecodecontainer.h b/mozilla/js2/src/bytecodecontainer.h
index c3a36253608..c3711604137 100644
--- a/mozilla/js2/src/bytecodecontainer.h
+++ b/mozilla/js2/src/bytecodecontainer.h
@@ -148,12 +148,13 @@ public:
// XXX We lose StringAtom here (and is it safe to stash the address of a StringAtom?)
// - is there any way of keeping StringAtoms themselves in a bytecodeContainer?
- void addRegExp(RegExpInstance *x, size_t pos) { emitOp(eRegExp, pos); addPointer(x); }
+ void addRegExp(RegExpInstance *x, size_t pos) { emitOp(eRegExp, pos); mRegExpList.push_back(x); addShort(mRegExpList.size() - 1); }
typedef std::vector CodeBuffer;
CodeBuffer mBuffer;
+ std::vector mRegExpList; // gc tracking
std::vector mMultinameList; // gc tracking
std::vector mFrameList; // gc tracking
diff --git a/mozilla/js2/src/epimetheus.cpp b/mozilla/js2/src/epimetheus.cpp
index 72838be2118..3b2857c618f 100644
--- a/mozilla/js2/src/epimetheus.cpp
+++ b/mozilla/js2/src/epimetheus.cpp
@@ -146,7 +146,7 @@ static int readEvalPrint(FILE *in)
metadata->ValidateStmtList(parsedStatements);
js2val rval = metadata->ExecuteStmtList(RunPhase, parsedStatements);
if (!JS2VAL_IS_VOID(rval))
- stdOut << *metadata->engine->toString(rval) << '\n';
+ stdOut << *metadata->toString(rval) << '\n';
}
}
clear(buffer);
@@ -204,7 +204,7 @@ using namespace MetaData;
js2val print(JS2Metadata *meta, const js2val thisValue, js2val argv[], uint32 argc)
{
for (uint32 i = 0; i < argc; i++) {
- stdOut << *metadata->engine->toString(argv[i]) << '\n';
+ stdOut << *metadata->toString(argv[i]) << '\n';
}
return JS2VAL_UNDEFINED;
}
@@ -212,7 +212,7 @@ js2val print(JS2Metadata *meta, const js2val thisValue, js2val argv[], uint32 ar
js2val load(JS2Metadata *meta, const js2val thisValue, js2val argv[], uint32 argc)
{
if (argc)
- return meta->readEvalFile(*meta->engine->toString(argv[0]));
+ return meta->readEvalFile(*meta->toString(argv[0]));
else
return JS2VAL_UNDEFINED;
}
diff --git a/mozilla/js2/src/js2array.cpp b/mozilla/js2/src/js2array.cpp
new file mode 100644
index 00000000000..3e09239f5f1
--- /dev/null
+++ b/mozilla/js2/src/js2array.cpp
@@ -0,0 +1,852 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
+ *
+ * The contents of this file are subject to the Netscape 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/NPL/
+ *
+ * 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 the JavaScript 2 Prototype.
+ *
+ * The Initial Developer of the Original Code is Netscape
+ * Communications Corporation. Portions created by Netscape are
+ * Copyright (C) 1998 Netscape Communications Corporation. All
+ * Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the
+ * terms of the GNU Public License (the "GPL"), in which case the
+ * provisions of the GPL are applicable instead of those above.
+ * If you wish to allow use of your version of this file only
+ * under the terms of the GPL and not to allow others to use your
+ * version of this file under the NPL, indicate your decision by
+ * deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL. If you do not delete
+ * the provisions above, a recipient may use your version of this
+ * file under either the NPL or the GPL.
+ */
+
+#ifdef _WIN32
+ // Turn off warnings about identifiers too long in browser information
+#pragma warning(disable: 4786)
+#pragma warning(disable: 4711)
+#pragma warning(disable: 4710)
+#endif
+
+#include
+#include
+#include