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 15104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
15115 LocalContext env; | 15115 LocalContext env; |
15116 i::Factory* factory = CcTest::i_isolate()->factory(); | 15116 i::Factory* factory = CcTest::i_isolate()->factory(); |
15117 v8::HandleScope scope(env->GetIsolate()); | 15117 v8::HandleScope scope(env->GetIsolate()); |
15118 AsciiVectorResource ascii_resource( | 15118 AsciiVectorResource ascii_resource( |
15119 i::Vector<const char>(c_string, i::StrLength(c_string))); | 15119 i::Vector<const char>(c_string, i::StrLength(c_string))); |
15120 UC16VectorResource uc16_resource( | 15120 UC16VectorResource uc16_resource( |
15121 i::Vector<const uint16_t>(two_byte_string, | 15121 i::Vector<const uint16_t>(two_byte_string, |
15122 i::StrLength(c_string))); | 15122 i::StrLength(c_string))); |
15123 | 15123 |
15124 Local<String> lhs(v8::Utils::ToLocal( | 15124 Local<String> lhs(v8::Utils::ToLocal( |
15125 factory->NewExternalStringFromAscii(&ascii_resource))); | 15125 factory->NewExternalStringFromAscii(&ascii_resource) |
| 15126 .ToHandleChecked())); |
15126 Local<String> rhs(v8::Utils::ToLocal( | 15127 Local<String> rhs(v8::Utils::ToLocal( |
15127 factory->NewExternalStringFromAscii(&ascii_resource))); | 15128 factory->NewExternalStringFromAscii(&ascii_resource) |
| 15129 .ToHandleChecked())); |
15128 | 15130 |
15129 env->Global()->Set(v8_str("lhs"), lhs); | 15131 env->Global()->Set(v8_str("lhs"), lhs); |
15130 env->Global()->Set(v8_str("rhs"), rhs); | 15132 env->Global()->Set(v8_str("rhs"), rhs); |
15131 | 15133 |
15132 CompileRun( | 15134 CompileRun( |
15133 "var cons = lhs + rhs;" | 15135 "var cons = lhs + rhs;" |
15134 "var slice = lhs.substring(1, lhs.length - 1);" | 15136 "var slice = lhs.substring(1, lhs.length - 1);" |
15135 "var slice_on_cons = (lhs + rhs).substring(1, lhs.length *2 - 1);"); | 15137 "var slice_on_cons = (lhs + rhs).substring(1, lhs.length *2 - 1);"); |
15136 | 15138 |
15137 CHECK(lhs->IsOneByte()); | 15139 CHECK(lhs->IsOneByte()); |
(...skipping 7277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
22415 "f.call(friend);"); | 22417 "f.call(friend);"); |
22416 CHECK_EQ(2, named_access_count); | 22418 CHECK_EQ(2, named_access_count); |
22417 | 22419 |
22418 // Test access using Object.setPrototypeOf reflective method. | 22420 // Test access using Object.setPrototypeOf reflective method. |
22419 named_access_count = 0; | 22421 named_access_count = 0; |
22420 CompileRun("Object.setPrototypeOf(friend, {});"); | 22422 CompileRun("Object.setPrototypeOf(friend, {});"); |
22421 CHECK_EQ(1, named_access_count); | 22423 CHECK_EQ(1, named_access_count); |
22422 CompileRun("Object.getPrototypeOf(friend);"); | 22424 CompileRun("Object.getPrototypeOf(friend);"); |
22423 CHECK_EQ(2, named_access_count); | 22425 CHECK_EQ(2, named_access_count); |
22424 } | 22426 } |
OLD | NEW |