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 421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
432 | 432 |
433 | 433 |
434 #define CHECK_EQU(v1, v2) CHECK_EQ(static_cast<int>(v1), static_cast<int>(v2)) | 434 #define CHECK_EQU(v1, v2) CHECK_EQ(static_cast<int>(v1), static_cast<int>(v2)) |
435 | 435 |
436 void TestCharacterStream(const char* ascii_source, | 436 void TestCharacterStream(const char* ascii_source, |
437 unsigned length, | 437 unsigned length, |
438 unsigned start = 0, | 438 unsigned start = 0, |
439 unsigned end = 0) { | 439 unsigned end = 0) { |
440 if (end == 0) end = length; | 440 if (end == 0) end = length; |
441 unsigned sub_length = end - start; | 441 unsigned sub_length = end - start; |
442 i::HandleScope test_scope; | 442 i::HandleScope test_scope(i::Isolate::Current()); |
443 i::SmartArrayPointer<i::uc16> uc16_buffer(new i::uc16[length]); | 443 i::SmartArrayPointer<i::uc16> uc16_buffer(new i::uc16[length]); |
444 for (unsigned i = 0; i < length; i++) { | 444 for (unsigned i = 0; i < length; i++) { |
445 uc16_buffer[i] = static_cast<i::uc16>(ascii_source[i]); | 445 uc16_buffer[i] = static_cast<i::uc16>(ascii_source[i]); |
446 } | 446 } |
447 i::Vector<const char> ascii_vector(ascii_source, static_cast<int>(length)); | 447 i::Vector<const char> ascii_vector(ascii_source, static_cast<int>(length)); |
448 i::Handle<i::String> ascii_string( | 448 i::Handle<i::String> ascii_string( |
449 FACTORY->NewStringFromAscii(ascii_vector)); | 449 FACTORY->NewStringFromAscii(ascii_vector)); |
450 TestExternalResource resource(*uc16_buffer, length); | 450 TestExternalResource resource(*uc16_buffer, length); |
451 i::Handle<i::String> uc16_string( | 451 i::Handle<i::String> uc16_string( |
452 FACTORY->NewExternalStringFromTwoByte(&resource)); | 452 FACTORY->NewExternalStringFromTwoByte(&resource)); |
(...skipping 823 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1276 " b = function() { \n" | 1276 " b = function() { \n" |
1277 " 01; \n" | 1277 " 01; \n" |
1278 " }; \n" | 1278 " }; \n" |
1279 "}; \n"; | 1279 "}; \n"; |
1280 v8::Script::Compile(v8::String::New(script)); | 1280 v8::Script::Compile(v8::String::New(script)); |
1281 CHECK(try_catch.HasCaught()); | 1281 CHECK(try_catch.HasCaught()); |
1282 v8::String::Utf8Value exception(try_catch.Exception()); | 1282 v8::String::Utf8Value exception(try_catch.Exception()); |
1283 CHECK_EQ("SyntaxError: Octal literals are not allowed in strict mode.", | 1283 CHECK_EQ("SyntaxError: Octal literals are not allowed in strict mode.", |
1284 *exception); | 1284 *exception); |
1285 } | 1285 } |
OLD | NEW |