| 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 14594 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 14605 UC16VectorResource uc16_resource( | 14605 UC16VectorResource uc16_resource( |
| 14606 i::Vector<const uint16_t>(two_byte_string, | 14606 i::Vector<const uint16_t>(two_byte_string, |
| 14607 i::StrLength(ascii_sources[i]))); | 14607 i::StrLength(ascii_sources[i]))); |
| 14608 v8::Local<v8::String> source = v8::String::NewExternal(&uc16_resource); | 14608 v8::Local<v8::String> source = v8::String::NewExternal(&uc16_resource); |
| 14609 v8::Script::Compile(source); | 14609 v8::Script::Compile(source); |
| 14610 i::DeleteArray(two_byte_string); | 14610 i::DeleteArray(two_byte_string); |
| 14611 } | 14611 } |
| 14612 } | 14612 } |
| 14613 | 14613 |
| 14614 | 14614 |
| 14615 #ifndef V8_INTERPRETED_REGEXP |
| 14616 |
| 14615 struct RegExpInterruptionData { | 14617 struct RegExpInterruptionData { |
| 14616 int loop_count; | 14618 int loop_count; |
| 14617 UC16VectorResource* string_resource; | 14619 UC16VectorResource* string_resource; |
| 14618 v8::Persistent<v8::String> string; | 14620 v8::Persistent<v8::String> string; |
| 14619 } regexp_interruption_data; | 14621 } regexp_interruption_data; |
| 14620 | 14622 |
| 14621 | 14623 |
| 14622 class RegExpInterruptionThread : public i::Thread { | 14624 class RegExpInterruptionThread : public i::Thread { |
| 14623 public: | 14625 public: |
| 14624 explicit RegExpInterruptionThread(v8::Isolate* isolate) | 14626 explicit RegExpInterruptionThread(v8::Isolate* isolate) |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 14674 | 14676 |
| 14675 CompileRun("/((a*)*)*b/.exec(a)"); | 14677 CompileRun("/((a*)*)*b/.exec(a)"); |
| 14676 CHECK(try_catch.HasTerminated()); | 14678 CHECK(try_catch.HasTerminated()); |
| 14677 | 14679 |
| 14678 timeout_thread.Join(); | 14680 timeout_thread.Join(); |
| 14679 | 14681 |
| 14680 delete regexp_interruption_data.string_resource; | 14682 delete regexp_interruption_data.string_resource; |
| 14681 regexp_interruption_data.string.Dispose(); | 14683 regexp_interruption_data.string.Dispose(); |
| 14682 } | 14684 } |
| 14683 | 14685 |
| 14686 #endif // V8_INTERPRETED_REGEXP |
| 14687 |
| 14684 | 14688 |
| 14685 // Test that we cannot set a property on the global object if there | 14689 // Test that we cannot set a property on the global object if there |
| 14686 // is a read-only property in the prototype chain. | 14690 // is a read-only property in the prototype chain. |
| 14687 TEST(ReadOnlyPropertyInGlobalProto) { | 14691 TEST(ReadOnlyPropertyInGlobalProto) { |
| 14688 i::FLAG_es5_readonly = true; | 14692 i::FLAG_es5_readonly = true; |
| 14689 v8::HandleScope scope(CcTest::isolate()); | 14693 v8::HandleScope scope(CcTest::isolate()); |
| 14690 v8::Handle<v8::ObjectTemplate> templ = v8::ObjectTemplate::New(); | 14694 v8::Handle<v8::ObjectTemplate> templ = v8::ObjectTemplate::New(); |
| 14691 LocalContext context(0, templ); | 14695 LocalContext context(0, templ); |
| 14692 v8::Handle<v8::Object> global = context->Global(); | 14696 v8::Handle<v8::Object> global = context->Global(); |
| 14693 v8::Handle<v8::Object> global_proto = | 14697 v8::Handle<v8::Object> global_proto = |
| (...skipping 5839 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 20533 } | 20537 } |
| 20534 for (int i = 0; i < runs; i++) { | 20538 for (int i = 0; i < runs; i++) { |
| 20535 Local<String> expected; | 20539 Local<String> expected; |
| 20536 if (i != 0) { | 20540 if (i != 0) { |
| 20537 CHECK_EQ(v8_str("escape value"), values[i]); | 20541 CHECK_EQ(v8_str("escape value"), values[i]); |
| 20538 } else { | 20542 } else { |
| 20539 CHECK(values[i].IsEmpty()); | 20543 CHECK(values[i].IsEmpty()); |
| 20540 } | 20544 } |
| 20541 } | 20545 } |
| 20542 } | 20546 } |
| OLD | NEW |