Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(254)

Side by Side Diff: src/d8.cc

Issue 9185006: Correct nits in d8 ArrayBuffer() implementation (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | test/mjsunit/external-array.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | test/mjsunit/external-array.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698