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 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
380 | 380 |
381 // The given byteOffset must be a multiple of the element size of the | 381 // The given byteOffset must be a multiple of the element size of the |
382 // specific type, otherwise an exception is raised. | 382 // specific type, otherwise an exception is raised. |
383 if (offset % element_size != 0) { | 383 if (offset % element_size != 0) { |
384 return ThrowException( | 384 return ThrowException( |
385 String::New("offset must be multiple of element_size")); | 385 String::New("offset must be multiple of element_size")); |
386 } | 386 } |
387 } | 387 } |
388 | 388 |
389 if (offset > array_buffer_length) { | 389 if (offset > array_buffer_length) { |
390 return ThrowException( | 390 return ThrowException( |
391 String::New("byteOffset must be less than ArrayBuffer length.")); | 391 String::New("byteOffset must be less than ArrayBuffer length.")); |
392 } | 392 } |
393 | 393 |
394 if (args.Length() == 2) { | 394 if (args.Length() == 2) { |
395 // If length is not explicitly specified, the length of the ArrayBuffer | 395 // If length is not explicitly specified, the length of the ArrayBuffer |
396 // minus the byteOffset must be a multiple of the element size of the | 396 // minus the byteOffset must be a multiple of the element size of the |
397 // specific type, or an exception is raised. | 397 // specific type, or an exception is raised. |
398 length = array_buffer_length - offset; | 398 length = array_buffer_length - offset; |
399 } | 399 } |
400 | 400 |
401 if (args.Length() != 3) { | 401 if (args.Length() != 3) { |
(...skipping 1102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1504 } | 1504 } |
1505 | 1505 |
1506 } // namespace v8 | 1506 } // namespace v8 |
1507 | 1507 |
1508 | 1508 |
1509 #ifndef GOOGLE3 | 1509 #ifndef GOOGLE3 |
1510 int main(int argc, char* argv[]) { | 1510 int main(int argc, char* argv[]) { |
1511 return v8::Shell::Main(argc, argv); | 1511 return v8::Shell::Main(argc, argv); |
1512 } | 1512 } |
1513 #endif | 1513 #endif |
OLD | NEW |