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

Unified Diff: src/i18n.cc

Issue 2600913002: [intl] Remove redundant type checking system (Closed)
Patch Set: 80col limit Created 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/js/i18n.js » ('j') | no next file with comments »
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 58b8a8dc5c7a5d9df902b01201763df958fd5a3c..bb7423c845a2a2bed4ccb2b1fb6053e7d247714f 100644
--- a/src/i18n.cc
+++ b/src/i18n.cc
@@ -759,16 +759,7 @@ icu::SimpleDateFormat* DateFormat::InitializeDateTimeFormat(
icu::SimpleDateFormat* DateFormat::UnpackDateFormat(
Isolate* isolate,
Handle<JSObject> obj) {
- Handle<String> key =
- isolate->factory()->NewStringFromStaticChars("dateFormat");
- Maybe<bool> maybe = JSReceiver::HasOwnProperty(obj, key);
- CHECK(maybe.IsJust());
- if (maybe.FromJust()) {
- return reinterpret_cast<icu::SimpleDateFormat*>(
- obj->GetInternalField(0));
- }
-
- return NULL;
+ return reinterpret_cast<icu::SimpleDateFormat*>(obj->GetInternalField(0));
}
void DateFormat::DeleteDateFormat(const v8::WeakCallbackInfo<void>& data) {
@@ -823,15 +814,7 @@ icu::DecimalFormat* NumberFormat::InitializeNumberFormat(
icu::DecimalFormat* NumberFormat::UnpackNumberFormat(
Isolate* isolate,
Handle<JSObject> obj) {
- Handle<String> key =
- isolate->factory()->NewStringFromStaticChars("numberFormat");
- Maybe<bool> maybe = JSReceiver::HasOwnProperty(obj, key);
- CHECK(maybe.IsJust());
- if (maybe.FromJust()) {
- return reinterpret_cast<icu::DecimalFormat*>(obj->GetInternalField(0));
- }
-
- return NULL;
+ return reinterpret_cast<icu::DecimalFormat*>(obj->GetInternalField(0));
}
void NumberFormat::DeleteNumberFormat(const v8::WeakCallbackInfo<void>& data) {
@@ -883,14 +866,7 @@ icu::Collator* Collator::InitializeCollator(
icu::Collator* Collator::UnpackCollator(Isolate* isolate,
Handle<JSObject> obj) {
- Handle<String> key = isolate->factory()->NewStringFromStaticChars("collator");
- Maybe<bool> maybe = JSReceiver::HasOwnProperty(obj, key);
- CHECK(maybe.IsJust());
- if (maybe.FromJust()) {
- return reinterpret_cast<icu::Collator*>(obj->GetInternalField(0));
- }
-
- return NULL;
+ return reinterpret_cast<icu::Collator*>(obj->GetInternalField(0));
}
void Collator::DeleteCollator(const v8::WeakCallbackInfo<void>& data) {
@@ -945,15 +921,7 @@ icu::BreakIterator* BreakIterator::InitializeBreakIterator(
icu::BreakIterator* BreakIterator::UnpackBreakIterator(Isolate* isolate,
Handle<JSObject> obj) {
- Handle<String> key =
- isolate->factory()->NewStringFromStaticChars("breakIterator");
- Maybe<bool> maybe = JSReceiver::HasOwnProperty(obj, key);
- CHECK(maybe.IsJust());
- if (maybe.FromJust()) {
- return reinterpret_cast<icu::BreakIterator*>(obj->GetInternalField(0));
- }
-
- return NULL;
+ return reinterpret_cast<icu::BreakIterator*>(obj->GetInternalField(0));
}
void BreakIterator::DeleteBreakIterator(
« no previous file with comments | « no previous file | src/js/i18n.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698