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 514 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
525 if (try_catch.HasCaught()) return try_catch.ReThrow(); | 525 if (try_catch.HasCaught()) return try_catch.ReThrow(); |
526 byteLength = length * element_size; | 526 byteLength = length * element_size; |
527 if (byteOffset + byteLength > bufferLength) { | 527 if (byteOffset + byteLength > bufferLength) { |
528 return Throw("length out of bounds"); | 528 return Throw("length out of bounds"); |
529 } | 529 } |
530 } | 530 } |
531 } else { | 531 } else { |
532 if (args[0]->IsObject() && | 532 if (args[0]->IsObject() && |
533 args[0]->ToObject()->Has(Symbols::length(isolate))) { | 533 args[0]->ToObject()->Has(Symbols::length(isolate))) { |
534 // Construct from array. | 534 // Construct from array. |
535 length = convertToUint( | 535 Local<Value> value = args[0]->ToObject()->Get(Symbols::length(isolate)); |
536 args[0]->ToObject()->Get(Symbols::length(isolate)), &try_catch); | 536 if (try_catch.HasCaught()) return try_catch.ReThrow(); |
| 537 length = convertToUint(value, &try_catch); |
537 if (try_catch.HasCaught()) return try_catch.ReThrow(); | 538 if (try_catch.HasCaught()) return try_catch.ReThrow(); |
538 init_from_array = true; | 539 init_from_array = true; |
539 } else { | 540 } else { |
540 // Construct from size. | 541 // Construct from size. |
541 length = convertToUint(args[0], &try_catch); | 542 length = convertToUint(args[0], &try_catch); |
542 if (try_catch.HasCaught()) return try_catch.ReThrow(); | 543 if (try_catch.HasCaught()) return try_catch.ReThrow(); |
543 } | 544 } |
544 byteLength = length * element_size; | 545 byteLength = length * element_size; |
545 byteOffset = 0; | 546 byteOffset = 0; |
546 | 547 |
(...skipping 1415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1962 } | 1963 } |
1963 | 1964 |
1964 } // namespace v8 | 1965 } // namespace v8 |
1965 | 1966 |
1966 | 1967 |
1967 #ifndef GOOGLE3 | 1968 #ifndef GOOGLE3 |
1968 int main(int argc, char* argv[]) { | 1969 int main(int argc, char* argv[]) { |
1969 return v8::Shell::Main(argc, argv); | 1970 return v8::Shell::Main(argc, argv); |
1970 } | 1971 } |
1971 #endif | 1972 #endif |
OLD | NEW |