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

Side by Side Diff: src/array.js

Issue 13412003: Demo for WebKit bug #113735 (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 8 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 | no next file » | 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 723 matching lines...) Expand 10 before | Expand all | Expand 10 after
734 var arguments_length = %_ArgumentsLength(); 734 var arguments_length = %_ArgumentsLength();
735 while (arguments_index < arguments_length) { 735 while (arguments_index < arguments_length) {
736 this[i++] = %_Arguments(arguments_index++); 736 this[i++] = %_Arguments(arguments_index++);
737 } 737 }
738 this.length = len - del_count + num_additional_args; 738 this.length = len - del_count + num_additional_args;
739 739
740 // Return the deleted elements. 740 // Return the deleted elements.
741 return deleted_elements; 741 return deleted_elements;
742 } 742 }
743 743
744 if ( IS_NULL_OR_UNDEFINED((function(){return this;})()) ) {
745 throw "Failed check for bad global object";
746 }
744 747
745 function ArraySort(comparefn) { 748 function ArraySort(comparefn) {
746 if (IS_NULL_OR_UNDEFINED(this) && !IS_UNDETECTABLE(this)) { 749 if (IS_NULL_OR_UNDEFINED(this) && !IS_UNDETECTABLE(this)) {
747 throw MakeTypeError("called_on_null_or_undefined", 750 throw MakeTypeError("called_on_null_or_undefined",
748 ["Array.prototype.sort"]); 751 ["Array.prototype.sort"]);
749 } 752 }
750 753
751 // In-place QuickSort algorithm. 754 // In-place QuickSort algorithm.
752 // For short (length <= 22) arrays, insertion sort is used for efficiency. 755 // For short (length <= 22) arrays, insertion sort is used for efficiency.
753 756
(...skipping 808 matching lines...) Expand 10 before | Expand all | Expand 10 after
1562 )); 1565 ));
1563 1566
1564 SetUpLockedPrototype(InternalPackedArray, $Array(), $Array( 1567 SetUpLockedPrototype(InternalPackedArray, $Array(), $Array(
1565 "join", getFunction("join", ArrayJoin), 1568 "join", getFunction("join", ArrayJoin),
1566 "pop", getFunction("pop", ArrayPop), 1569 "pop", getFunction("pop", ArrayPop),
1567 "push", getFunction("push", ArrayPush) 1570 "push", getFunction("push", ArrayPush)
1568 )); 1571 ));
1569 } 1572 }
1570 1573
1571 SetUpArray(); 1574 SetUpArray();
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698