OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
246 | 246 |
247 TEST(StandAlonePreParser) { | 247 TEST(StandAlonePreParser) { |
248 int marker; | 248 int marker; |
249 i::Isolate::Current()->stack_guard()->SetStackLimit( | 249 i::Isolate::Current()->stack_guard()->SetStackLimit( |
250 reinterpret_cast<uintptr_t>(&marker) - 128 * 1024); | 250 reinterpret_cast<uintptr_t>(&marker) - 128 * 1024); |
251 | 251 |
252 const char* programs[] = { | 252 const char* programs[] = { |
253 "{label: 42}", | 253 "{label: 42}", |
254 "var x = 42;", | 254 "var x = 42;", |
255 "function foo(x, y) { return x + y; }", | 255 "function foo(x, y) { return x + y; }", |
256 "native function foo(); return %ArgleBargle(glop);", | 256 "%ArgleBargle(glop);", |
257 "var x = new new Function('this.x = 42');", | 257 "var x = new new Function('this.x = 42');", |
258 NULL | 258 NULL |
259 }; | 259 }; |
260 | 260 |
261 uintptr_t stack_limit = i::Isolate::Current()->stack_guard()->real_climit(); | 261 uintptr_t stack_limit = i::Isolate::Current()->stack_guard()->real_climit(); |
262 for (int i = 0; programs[i]; i++) { | 262 for (int i = 0; programs[i]; i++) { |
263 const char* program = programs[i]; | 263 const char* program = programs[i]; |
264 i::Utf8ToUC16CharacterStream stream( | 264 i::Utf8ToUC16CharacterStream stream( |
265 reinterpret_cast<const i::byte*>(program), | 265 reinterpret_cast<const i::byte*>(program), |
266 static_cast<unsigned>(strlen(program))); | 266 static_cast<unsigned>(strlen(program))); |
(...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
697 TestScanRegExp("/[\\u12]/flipperwald", "[\\u12]"); | 697 TestScanRegExp("/[\\u12]/flipperwald", "[\\u12]"); |
698 TestScanRegExp("/[\\u123]/flipperwald", "[\\u123]"); | 698 TestScanRegExp("/[\\u123]/flipperwald", "[\\u123]"); |
699 // Escaped ']'s wont end the character class. | 699 // Escaped ']'s wont end the character class. |
700 TestScanRegExp("/[\\]/]/flipperwald", "[\\]/]"); | 700 TestScanRegExp("/[\\]/]/flipperwald", "[\\]/]"); |
701 // Escaped slashes are not terminating. | 701 // Escaped slashes are not terminating. |
702 TestScanRegExp("/\\//flipperwald", "\\/"); | 702 TestScanRegExp("/\\//flipperwald", "\\/"); |
703 // Starting with '=' works too. | 703 // Starting with '=' works too. |
704 TestScanRegExp("/=/", "="); | 704 TestScanRegExp("/=/", "="); |
705 TestScanRegExp("/=?/", "=?"); | 705 TestScanRegExp("/=?/", "=?"); |
706 } | 706 } |
OLD | NEW |