Version 3.2.0
Fixed a number of crash bugs.
Turned on Crankshaft by default on x64 and ARM.
Improved Crankshaft for x64 and ARM.
Implemented more of EcmaScript 5 strict mode.
git-svn-id: http://v8.googlecode.com/svn/trunk@7077 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
diff --git a/src/jsregexp.cc b/src/jsregexp.cc
index 8e7c35f..b271b02 100644
--- a/src/jsregexp.cc
+++ b/src/jsregexp.cc
@@ -97,9 +97,10 @@
Handle<String> pattern,
Handle<String> error_text,
const char* message) {
- Handle<JSArray> array = Factory::NewJSArray(2);
- SetElement(array, 0, pattern);
- SetElement(array, 1, error_text);
+ Handle<FixedArray> elements = Factory::NewFixedArray(2);
+ elements->set(0, *pattern);
+ elements->set(1, *error_text);
+ Handle<JSArray> array = Factory::NewJSArrayWithElements(elements);
Handle<Object> regexp_err = Factory::NewSyntaxError(message, array);
Top::Throw(*regexp_err);
}
@@ -325,11 +326,12 @@
is_ascii);
if (result.error_message != NULL) {
// Unable to compile regexp.
- Handle<JSArray> array = Factory::NewJSArray(2);
- SetElement(array, 0, pattern);
- SetElement(array,
- 1,
- Factory::NewStringFromUtf8(CStrVector(result.error_message)));
+ Handle<FixedArray> elements = Factory::NewFixedArray(2);
+ elements->set(0, *pattern);
+ Handle<String> error_message =
+ Factory::NewStringFromUtf8(CStrVector(result.error_message));
+ elements->set(1, *error_message);
+ Handle<JSArray> array = Factory::NewJSArrayWithElements(elements);
Handle<Object> regexp_err =
Factory::NewSyntaxError("malformed_regexp", array);
Top::Throw(*regexp_err);