| Index: src/parser.cc
|
| diff --git a/src/parser.cc b/src/parser.cc
|
| index 24eaef0c3d34c51e45a11b17fcd121d5a0e9e84e..7eeb37e4b031168ebec36e75f2e3c12c70bb7fa1 100644
|
| --- a/src/parser.cc
|
| +++ b/src/parser.cc
|
| @@ -559,31 +559,38 @@ int ParserTraits::NextMaterializedLiteralIndex() {
|
| void ParserTraits::ReportMessageAt(Scanner::Location source_location,
|
| const char* message,
|
| Vector<const char*> args) {
|
| + fprintf(stderr, "ParserTraits::ReportMessageAt\n");
|
| MessageLocation location(parser_->script_,
|
| source_location.beg_pos,
|
| source_location.end_pos);
|
| + fprintf(stderr, "message %s, args len %d\n", message, args.length());
|
| Factory* factory = parser_->isolate()->factory();
|
| Handle<FixedArray> elements = factory->NewFixedArray(args.length());
|
| for (int i = 0; i < args.length(); i++) {
|
| + fprintf(stderr, "looping %d %s\n", i, 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(message, array);
|
| parser_->isolate()->Throw(*result, &location);
|
| + fprintf(stderr, "ParserTraits::ReportMessageAt returns\n");
|
| }
|
|
|
|
|
| void ParserTraits::ReportMessage(const char* message,
|
| Vector<Handle<String> > args) {
|
| + fprintf(stderr, "ParserTraits::ReportMessage\n");
|
| Scanner::Location source_location = parser_->scanner().location();
|
| ReportMessageAt(source_location, message, args);
|
| + fprintf(stderr, "ParserTraits::ReportMessage returns\n");
|
| }
|
|
|
|
|
| void ParserTraits::ReportMessageAt(Scanner::Location source_location,
|
| const char* message,
|
| Vector<Handle<String> > args) {
|
| + fprintf(stderr, "ParserTraits::ReportMessageAtB\n");
|
| MessageLocation location(parser_->script_,
|
| source_location.beg_pos,
|
| source_location.end_pos);
|
| @@ -595,6 +602,7 @@ void ParserTraits::ReportMessageAt(Scanner::Location source_location,
|
| Handle<JSArray> array = factory->NewJSArrayWithElements(elements);
|
| Handle<Object> result = factory->NewSyntaxError(message, array);
|
| parser_->isolate()->Throw(*result, &location);
|
| + fprintf(stderr, "ParserTraits::ReportMessageAtB returns\n");
|
| }
|
|
|
|
|
| @@ -3496,10 +3504,25 @@ DebuggerStatement* Parser::ParseDebuggerStatement(bool* ok) {
|
|
|
|
|
| void Parser::ReportInvalidPreparseData(Handle<String> name, bool* ok) {
|
| + fprintf(stderr, "ReportInvalidPreparseData\n");
|
| SmartArrayPointer<char> name_string = name->ToCString(DISALLOW_NULLS);
|
| const char* element[1] = { name_string.get() };
|
| - ReportMessage("invalid_preparser_data",
|
| - Vector<const char*>(element, 1));
|
| + Vector<const char*> args_array(element, 1);
|
| + fprintf(stderr, "constructed args array, length is %d\n", args_array.length());
|
| +
|
| + // WTF: Adding this line makes it pass!!!
|
| + //fprintf(stderr, "args_array is at %p\n", reinterpret_cast<void*>(&args_array));
|
| +
|
| + // This is not enough:
|
| + // void* foo = reinterpret_cast<void*>(&args_array);
|
| + // USE(foo);
|
| +
|
| + // This is not enough either:
|
| + // const char* foo = reinterpret_cast<const char*>(&args_array);
|
| + // foo++;
|
| +
|
| + ReportMessage("invalid_preparser_data", args_array);
|
| + fprintf(stderr, "ReportInvalidPreparseData returns\n");
|
| *ok = false;
|
| }
|
|
|
|
|