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

Side by Side Diff: Source/bindings/core/v8/V8Binding.cpp

Issue 946293003: [bindings] Assert toDoubleSlow on v8::Value being a number. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 10 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 /* 1 /*
2 * Copyright (C) 2006, 2007, 2008, 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2008, 2009 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 are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * 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 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 515 matching lines...) Expand 10 before | Expand all | Expand 10 after
526 return 0; 526 return 0;
527 if (!std::isfinite(numberValue)) { 527 if (!std::isfinite(numberValue)) {
528 exceptionState.throwTypeError("The provided float value is non-finite.") ; 528 exceptionState.throwTypeError("The provided float value is non-finite.") ;
529 return 0; 529 return 0;
530 } 530 }
531 return numberValue; 531 return numberValue;
532 } 532 }
533 533
534 double toDoubleSlow(v8::Handle<v8::Value> value, ExceptionState& exceptionState) 534 double toDoubleSlow(v8::Handle<v8::Value> value, ExceptionState& exceptionState)
535 { 535 {
536 ASSERT(!value->IsNumber());
536 v8::Isolate* isolate = v8::Isolate::GetCurrent(); 537 v8::Isolate* isolate = v8::Isolate::GetCurrent();
537 v8::TryCatch block(isolate); 538 v8::TryCatch block(isolate);
538 double doubleValue = value->NumberValue(); 539 double doubleValue = value->NumberValue();
539 if (block.HasCaught()) { 540 if (block.HasCaught()) {
540 exceptionState.rethrowV8Exception(block.Exception()); 541 exceptionState.rethrowV8Exception(block.Exception());
541 return 0; 542 return 0;
542 } 543 }
543 return doubleValue; 544 return doubleValue;
544 } 545 }
545 546
(...skipping 540 matching lines...) Expand 10 before | Expand all | Expand 10 after
1086 attributes->append(value); 1087 attributes->append(value);
1087 } 1088 }
1088 1089
1089 AttributesWithSideEffectOnGet::AttributeSet* AttributesWithSideEffectOnGet::attr ibutesWithSideEffectOnGet() 1090 AttributesWithSideEffectOnGet::AttributeSet* AttributesWithSideEffectOnGet::attr ibutesWithSideEffectOnGet()
1090 { 1091 {
1091 DEFINE_STATIC_LOCAL(AttributeSet, attributes, ()); 1092 DEFINE_STATIC_LOCAL(AttributeSet, attributes, ());
1092 return &attributes; 1093 return &attributes;
1093 } 1094 }
1094 1095
1095 } // namespace blink 1096 } // namespace blink
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