| 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 543 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 554 if (try_catch.HasCaught()) return result; | 554 if (try_catch.HasCaught()) return result; |
| 555 buffer = result->ToObject(); | 555 buffer = result->ToObject(); |
| 556 } | 556 } |
| 557 | 557 |
| 558 Handle<Object> array = | 558 Handle<Object> array = |
| 559 CreateExternalArray(isolate, args.This(), buffer, type, length, | 559 CreateExternalArray(isolate, args.This(), buffer, type, length, |
| 560 byteLength, byteOffset, element_size); | 560 byteLength, byteOffset, element_size); |
| 561 | 561 |
| 562 if (init_from_array) { | 562 if (init_from_array) { |
| 563 Handle<Object> init = args[0]->ToObject(); | 563 Handle<Object> init = args[0]->ToObject(); |
| 564 for (int i = 0; i < length; ++i) array->Set(i, init->Get(i)); | 564 for (int i = 0; i < length; ++i) { |
| 565 Local<Value> value = init->Get(i); |
| 566 if (try_catch.HasCaught()) return try_catch.ReThrow(); |
| 567 array->Set(i, value); |
| 568 } |
| 565 } | 569 } |
| 566 | 570 |
| 567 return array; | 571 return array; |
| 568 } | 572 } |
| 569 | 573 |
| 570 | 574 |
| 571 Handle<Value> Shell::ArrayBufferSlice(const Arguments& args) { | 575 Handle<Value> Shell::ArrayBufferSlice(const Arguments& args) { |
| 572 TryCatch try_catch; | 576 TryCatch try_catch; |
| 573 | 577 |
| 574 if (!args.This()->IsObject()) { | 578 if (!args.This()->IsObject()) { |
| (...skipping 1388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1963 } | 1967 } |
| 1964 | 1968 |
| 1965 } // namespace v8 | 1969 } // namespace v8 |
| 1966 | 1970 |
| 1967 | 1971 |
| 1968 #ifndef GOOGLE3 | 1972 #ifndef GOOGLE3 |
| 1969 int main(int argc, char* argv[]) { | 1973 int main(int argc, char* argv[]) { |
| 1970 return v8::Shell::Main(argc, argv); | 1974 return v8::Shell::Main(argc, argv); |
| 1971 } | 1975 } |
| 1972 #endif | 1976 #endif |
| OLD | NEW |