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

Side by Side Diff: Source/modules/indexeddb/IDBCursor.cpp

Issue 120063002: Improve modules' TypeError exception messages. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase. Created 6 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after
384 { 384 {
385 if (directionString.isNull() || directionString == IDBCursor::directionNext( )) 385 if (directionString.isNull() || directionString == IDBCursor::directionNext( ))
386 return IndexedDB::CursorNext; 386 return IndexedDB::CursorNext;
387 if (directionString == IDBCursor::directionNextUnique()) 387 if (directionString == IDBCursor::directionNextUnique())
388 return IndexedDB::CursorNextNoDuplicate; 388 return IndexedDB::CursorNextNoDuplicate;
389 if (directionString == IDBCursor::directionPrev()) 389 if (directionString == IDBCursor::directionPrev())
390 return IndexedDB::CursorPrev; 390 return IndexedDB::CursorPrev;
391 if (directionString == IDBCursor::directionPrevUnique()) 391 if (directionString == IDBCursor::directionPrevUnique())
392 return IndexedDB::CursorPrevNoDuplicate; 392 return IndexedDB::CursorPrevNoDuplicate;
393 393
394 exceptionState.throwUninformativeAndGenericTypeError(); 394 exceptionState.throwTypeError("The direction provided ('" + directionString + "') is not one of 'next', 'nextunique', 'prev', or 'prevunique'.");
395 return IndexedDB::CursorNext; 395 return IndexedDB::CursorNext;
396 } 396 }
397 397
398 const AtomicString& IDBCursor::directionToString(unsigned short direction) 398 const AtomicString& IDBCursor::directionToString(unsigned short direction)
399 { 399 {
400 switch (direction) { 400 switch (direction) {
401 case IndexedDB::CursorNext: 401 case IndexedDB::CursorNext:
402 return IDBCursor::directionNext(); 402 return IDBCursor::directionNext();
403 403
404 case IndexedDB::CursorNextNoDuplicate: 404 case IndexedDB::CursorNextNoDuplicate:
405 return IDBCursor::directionNextUnique(); 405 return IDBCursor::directionNextUnique();
406 406
407 case IndexedDB::CursorPrev: 407 case IndexedDB::CursorPrev:
408 return IDBCursor::directionPrev(); 408 return IDBCursor::directionPrev();
409 409
410 case IndexedDB::CursorPrevNoDuplicate: 410 case IndexedDB::CursorPrevNoDuplicate:
411 return IDBCursor::directionPrevUnique(); 411 return IDBCursor::directionPrevUnique();
412 412
413 default: 413 default:
414 ASSERT_NOT_REACHED(); 414 ASSERT_NOT_REACHED();
415 return IDBCursor::directionNext(); 415 return IDBCursor::directionNext();
416 } 416 }
417 } 417 }
418 418
419 } // namespace WebCore 419 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/modules/imagebitmap/ImageBitmapFactories.cpp ('k') | Source/modules/indexeddb/IDBFactory.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698