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

Side by Side Diff: src/collection.js

Issue 1187473008: Bug demonstration: lookup failure in case expression in native js (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 6 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
« 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 // 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 var $getHash; 5 var $getHash;
6 var $getExistingHash; 6 var $getExistingHash;
7 var $mapFromArray; 7 var $mapFromArray;
8 var $setFromArray; 8 var $setFromArray;
9 9
10 (function(global, utils) { 10 (function(global, utils) {
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after
371 var chainEntry = ORDERED_HASH_TABLE_BUCKET_AT(table, bucket); 371 var chainEntry = ORDERED_HASH_TABLE_BUCKET_AT(table, bucket);
372 ORDERED_HASH_TABLE_SET_BUCKET_AT(table, bucket, entry); 372 ORDERED_HASH_TABLE_SET_BUCKET_AT(table, bucket, entry);
373 ORDERED_HASH_TABLE_SET_ELEMENT_COUNT(table, nof + 1); 373 ORDERED_HASH_TABLE_SET_ELEMENT_COUNT(table, nof + 1);
374 FIXED_ARRAY_SET(table, index, key); 374 FIXED_ARRAY_SET(table, index, key);
375 FIXED_ARRAY_SET(table, index + 1, value); 375 FIXED_ARRAY_SET(table, index + 1, value);
376 FIXED_ARRAY_SET(table, index + 2, chainEntry); 376 FIXED_ARRAY_SET(table, index + 2, chainEntry);
377 return this; 377 return this;
378 } 378 }
379 379
380 380
381 var GlobalFoo = 5;
382
383
381 function MapHas(key) { 384 function MapHas(key) {
385 switch (key) {
386 case GlobalFoo:
387 throw 'Adam was here';
388 }
389
382 if (!IS_MAP(this)) { 390 if (!IS_MAP(this)) {
383 throw MakeTypeError(kIncompatibleMethodReceiver, 391 throw MakeTypeError(kIncompatibleMethodReceiver,
384 'Map.prototype.has', this); 392 'Map.prototype.has', this);
385 } 393 }
386 var table = %_JSCollectionGetTable(this); 394 var table = %_JSCollectionGetTable(this);
387 var numBuckets = ORDERED_HASH_TABLE_BUCKET_COUNT(table); 395 var numBuckets = ORDERED_HASH_TABLE_BUCKET_COUNT(table);
388 var hash = GetHash(key); 396 var hash = GetHash(key);
389 return MapFindEntry(table, numBuckets, key, hash) !== NOT_FOUND; 397 return MapFindEntry(table, numBuckets, key, hash) !== NOT_FOUND;
390 } 398 }
391 399
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
496 $setFromArray = function(array) { 504 $setFromArray = function(array) {
497 var set = new GlobalSet; 505 var set = new GlobalSet;
498 var length = array.length; 506 var length = array.length;
499 for (var i = 0; i < length; ++i) { 507 for (var i = 0; i < length; ++i) {
500 %_CallFunction(set, array[i], SetAdd); 508 %_CallFunction(set, array[i], SetAdd);
501 } 509 }
502 return set; 510 return set;
503 }; 511 };
504 512
505 }) 513 })
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