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

Unified Diff: src/i18n.cc

Issue 418383002: Change Has* and Get*Attributes to return Maybe<*>, indicating possible exceptions. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/contexts.cc ('k') | src/isolate.h » ('j') | src/objects-inl.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/i18n.cc
diff --git a/src/i18n.cc b/src/i18n.cc
index c1e69739bd37f35a769c87d31bcba23d1f3345b2..2d67cf13eb2c9993a0cac90e66042257881653aa 100644
--- a/src/i18n.cc
+++ b/src/i18n.cc
@@ -419,7 +419,9 @@ void SetResolvedNumberSettings(Isolate* isolate,
Handle<String> key =
factory->NewStringFromStaticAscii("minimumSignificantDigits");
- if (JSReceiver::HasOwnProperty(resolved, key)) {
+ Maybe<bool> maybe = JSReceiver::HasOwnProperty(resolved, key);
+ CHECK(maybe.has_value);
+ if (maybe.value) {
JSObject::SetProperty(
resolved,
factory->NewStringFromStaticAscii("minimumSignificantDigits"),
@@ -428,7 +430,9 @@ void SetResolvedNumberSettings(Isolate* isolate,
}
key = factory->NewStringFromStaticAscii("maximumSignificantDigits");
- if (JSReceiver::HasOwnProperty(resolved, key)) {
+ maybe = JSReceiver::HasOwnProperty(resolved, key);
+ CHECK(maybe.has_value);
+ if (maybe.value) {
JSObject::SetProperty(
resolved,
factory->NewStringFromStaticAscii("maximumSignificantDigits"),
@@ -783,7 +787,9 @@ icu::SimpleDateFormat* DateFormat::UnpackDateFormat(
Handle<JSObject> obj) {
Handle<String> key =
isolate->factory()->NewStringFromStaticAscii("dateFormat");
- if (JSReceiver::HasOwnProperty(obj, key)) {
+ Maybe<bool> maybe = JSReceiver::HasOwnProperty(obj, key);
+ CHECK(maybe.has_value);
+ if (maybe.value) {
return reinterpret_cast<icu::SimpleDateFormat*>(
obj->GetInternalField(0));
}
@@ -857,7 +863,9 @@ icu::DecimalFormat* NumberFormat::UnpackNumberFormat(
Handle<JSObject> obj) {
Handle<String> key =
isolate->factory()->NewStringFromStaticAscii("numberFormat");
- if (JSReceiver::HasOwnProperty(obj, key)) {
+ Maybe<bool> maybe = JSReceiver::HasOwnProperty(obj, key);
+ CHECK(maybe.has_value);
+ if (maybe.value) {
return reinterpret_cast<icu::DecimalFormat*>(obj->GetInternalField(0));
}
@@ -912,7 +920,9 @@ icu::Collator* Collator::InitializeCollator(
icu::Collator* Collator::UnpackCollator(Isolate* isolate,
Handle<JSObject> obj) {
Handle<String> key = isolate->factory()->NewStringFromStaticAscii("collator");
- if (JSReceiver::HasOwnProperty(obj, key)) {
+ Maybe<bool> maybe = JSReceiver::HasOwnProperty(obj, key);
+ CHECK(maybe.has_value);
+ if (maybe.value) {
return reinterpret_cast<icu::Collator*>(obj->GetInternalField(0));
}
@@ -971,7 +981,9 @@ icu::BreakIterator* BreakIterator::UnpackBreakIterator(Isolate* isolate,
Handle<JSObject> obj) {
Handle<String> key =
isolate->factory()->NewStringFromStaticAscii("breakIterator");
- if (JSReceiver::HasOwnProperty(obj, key)) {
+ Maybe<bool> maybe = JSReceiver::HasOwnProperty(obj, key);
+ CHECK(maybe.has_value);
+ if (maybe.value) {
return reinterpret_cast<icu::BreakIterator*>(obj->GetInternalField(0));
}
« no previous file with comments | « src/contexts.cc ('k') | src/isolate.h » ('j') | src/objects-inl.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698