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

Side by Side Diff: src/collection.js

Issue 290733008: Teach OrderedHashSet::Remove to report whether it actually removed anything (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 7 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 | src/objects.h » ('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 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 "use strict"; 5 "use strict";
6 6
7 // This file relies on the fact that the following declaration has been made 7 // This file relies on the fact that the following declaration has been made
8 // in runtime.js: 8 // in runtime.js:
9 // var $Array = global.Array; 9 // var $Array = global.Array;
10 10
(...skipping 29 matching lines...) Expand all
40 } 40 }
41 return %SetHas(this, key); 41 return %SetHas(this, key);
42 } 42 }
43 43
44 44
45 function SetDeleteJS(key) { 45 function SetDeleteJS(key) {
46 if (!IS_SET(this)) { 46 if (!IS_SET(this)) {
47 throw MakeTypeError('incompatible_method_receiver', 47 throw MakeTypeError('incompatible_method_receiver',
48 ['Set.prototype.delete', this]); 48 ['Set.prototype.delete', this]);
49 } 49 }
50 if (%SetHas(this, key)) { 50 return %SetDelete(this, key);
51 %SetDelete(this, key);
52 return true;
53 } else {
54 return false;
55 }
56 } 51 }
57 52
58 53
59 function SetGetSizeJS() { 54 function SetGetSizeJS() {
60 if (!IS_SET(this)) { 55 if (!IS_SET(this)) {
61 throw MakeTypeError('incompatible_method_receiver', 56 throw MakeTypeError('incompatible_method_receiver',
62 ['Set.prototype.size', this]); 57 ['Set.prototype.size', this]);
63 } 58 }
64 return %SetGetSize(this); 59 return %SetGetSize(this);
65 } 60 }
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
218 "get", MapGetJS, 213 "get", MapGetJS,
219 "set", MapSetJS, 214 "set", MapSetJS,
220 "has", MapHasJS, 215 "has", MapHasJS,
221 "delete", MapDeleteJS, 216 "delete", MapDeleteJS,
222 "clear", MapClearJS, 217 "clear", MapClearJS,
223 "forEach", MapForEach 218 "forEach", MapForEach
224 )); 219 ));
225 } 220 }
226 221
227 SetUpMap(); 222 SetUpMap();
OLDNEW
« no previous file with comments | « no previous file | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698