OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
216 v8::String::NewExternal(isolate, resource); | 216 v8::String::NewExternal(isolate, resource); |
217 v8::Script::Compile(script_source, NULL, preparse); | 217 v8::Script::Compile(script_source, NULL, preparse); |
218 } | 218 } |
219 | 219 |
220 { | 220 { |
221 i::FLAG_lazy = false; | 221 i::FLAG_lazy = false; |
222 | 222 |
223 ScriptResource* resource = new ScriptResource(source, source_length); | 223 ScriptResource* resource = new ScriptResource(source, source_length); |
224 v8::Local<v8::String> script_source = | 224 v8::Local<v8::String> script_source = |
225 v8::String::NewExternal(isolate, resource); | 225 v8::String::NewExternal(isolate, resource); |
226 v8::Script::New(script_source, NULL, preparse, v8::Local<v8::String>()); | 226 v8::Script::New(script_source, NULL, preparse); |
227 } | 227 } |
228 delete preparse; | 228 delete preparse; |
229 i::FLAG_lazy = lazy_flag; | 229 i::FLAG_lazy = lazy_flag; |
230 | 230 |
231 // Syntax error. | 231 // Syntax error. |
232 v8::ScriptData* error_preparse = v8::ScriptData::PreCompile( | 232 v8::ScriptData* error_preparse = v8::ScriptData::PreCompile( |
233 v8::String::NewFromUtf8(isolate, | 233 v8::String::NewFromUtf8(isolate, |
234 error_source, | 234 error_source, |
235 v8::String::kNormalString, | 235 v8::String::kNormalString, |
236 error_source_length)); | 236 error_source_length)); |
(...skipping 1958 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2195 | 2195 |
2196 const char* statement_data[] = { | 2196 const char* statement_data[] = { |
2197 "new foo bar", | 2197 "new foo bar", |
2198 "new ) foo", | 2198 "new ) foo", |
2199 "new ++foo", | 2199 "new ++foo", |
2200 NULL | 2200 NULL |
2201 }; | 2201 }; |
2202 | 2202 |
2203 RunParserSyncTest(context_data, statement_data, kError); | 2203 RunParserSyncTest(context_data, statement_data, kError); |
2204 } | 2204 } |
OLD | NEW |