| Index: src/parser.cc
|
| diff --git a/src/parser.cc b/src/parser.cc
|
| index 856031070209f43a469bdc7420b5aac02654a9e5..62346ece73f60489bad2cd7c220f870e237e7083 100644
|
| --- a/src/parser.cc
|
| +++ b/src/parser.cc
|
| @@ -803,10 +803,12 @@ void Parser::ReportMessageAt(Scanner::Location source_location,
|
| MessageLocation location(script_,
|
| source_location.beg_pos,
|
| source_location.end_pos);
|
| - Handle<JSArray> array = Factory::NewJSArray(args.length());
|
| + Handle<FixedArray> elements = Factory::NewFixedArray(args.length());
|
| for (int i = 0; i < args.length(); i++) {
|
| - SetElement(array, i, Factory::NewStringFromUtf8(CStrVector(args[i])));
|
| + Handle<String> arg_string = Factory::NewStringFromUtf8(CStrVector(args[i]));
|
| + elements->set(i, *arg_string);
|
| }
|
| + Handle<JSArray> array = Factory::NewJSArrayWithElements(elements);
|
| Handle<Object> result = Factory::NewSyntaxError(type, array);
|
| Top::Throw(*result, &location);
|
| }
|
| @@ -818,10 +820,11 @@ void Parser::ReportMessageAt(Scanner::Location source_location,
|
| MessageLocation location(script_,
|
| source_location.beg_pos,
|
| source_location.end_pos);
|
| - Handle<JSArray> array = Factory::NewJSArray(args.length());
|
| + Handle<FixedArray> elements = Factory::NewFixedArray(args.length());
|
| for (int i = 0; i < args.length(); i++) {
|
| - SetElement(array, i, args[i]);
|
| + elements->set(i, *args[i]);
|
| }
|
| + Handle<JSArray> array = Factory::NewJSArrayWithElements(elements);
|
| Handle<Object> result = Factory::NewSyntaxError(type, array);
|
| Top::Throw(*result, &location);
|
| }
|
|
|