OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 779 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
790 *isolate->factory()->NewStringFromAscii(CStrVector("dateFormat")))) { | 790 *isolate->factory()->NewStringFromAscii(CStrVector("dateFormat")))) { |
791 return reinterpret_cast<icu::SimpleDateFormat*>( | 791 return reinterpret_cast<icu::SimpleDateFormat*>( |
792 obj->GetInternalField(0)); | 792 obj->GetInternalField(0)); |
793 } | 793 } |
794 | 794 |
795 return NULL; | 795 return NULL; |
796 } | 796 } |
797 | 797 |
798 | 798 |
799 void DateFormat::DeleteDateFormat(v8::Isolate* isolate, | 799 void DateFormat::DeleteDateFormat(v8::Isolate* isolate, |
800 Persistent<v8::Object>* object, | 800 Persistent<v8::Value>* object, |
801 void* param) { | 801 void* param) { |
802 // First delete the hidden C++ object. | 802 // First delete the hidden C++ object. |
803 delete reinterpret_cast<icu::SimpleDateFormat*>(Handle<JSObject>::cast( | 803 delete reinterpret_cast<icu::SimpleDateFormat*>(Handle<JSObject>::cast( |
804 v8::Utils::OpenPersistent(object))->GetInternalField(0)); | 804 v8::Utils::OpenPersistent(object))->GetInternalField(0)); |
805 | 805 |
806 // Then dispose of the persistent handle to JS object. | 806 // Then dispose of the persistent handle to JS object. |
807 object->Dispose(isolate); | 807 object->Dispose(isolate); |
808 } | 808 } |
809 | 809 |
810 | 810 |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
853 if (obj->HasLocalProperty(*isolate->factory()->NewStringFromAscii( | 853 if (obj->HasLocalProperty(*isolate->factory()->NewStringFromAscii( |
854 CStrVector("numberFormat")))) { | 854 CStrVector("numberFormat")))) { |
855 return reinterpret_cast<icu::DecimalFormat*>(obj->GetInternalField(0)); | 855 return reinterpret_cast<icu::DecimalFormat*>(obj->GetInternalField(0)); |
856 } | 856 } |
857 | 857 |
858 return NULL; | 858 return NULL; |
859 } | 859 } |
860 | 860 |
861 | 861 |
862 void NumberFormat::DeleteNumberFormat(v8::Isolate* isolate, | 862 void NumberFormat::DeleteNumberFormat(v8::Isolate* isolate, |
863 Persistent<v8::Object>* object, | 863 Persistent<v8::Value>* object, |
864 void* param) { | 864 void* param) { |
865 // First delete the hidden C++ object. | 865 // First delete the hidden C++ object. |
866 delete reinterpret_cast<icu::DecimalFormat*>(Handle<JSObject>::cast( | 866 delete reinterpret_cast<icu::DecimalFormat*>(Handle<JSObject>::cast( |
867 v8::Utils::OpenPersistent(object))->GetInternalField(0)); | 867 v8::Utils::OpenPersistent(object))->GetInternalField(0)); |
868 | 868 |
869 // Then dispose of the persistent handle to JS object. | 869 // Then dispose of the persistent handle to JS object. |
870 object->Dispose(isolate); | 870 object->Dispose(isolate); |
871 } | 871 } |
872 | 872 |
873 | 873 |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
913 if (obj->HasLocalProperty(*isolate->factory()->NewStringFromAscii( | 913 if (obj->HasLocalProperty(*isolate->factory()->NewStringFromAscii( |
914 CStrVector("collator")))) { | 914 CStrVector("collator")))) { |
915 return reinterpret_cast<icu::Collator*>(obj->GetInternalField(0)); | 915 return reinterpret_cast<icu::Collator*>(obj->GetInternalField(0)); |
916 } | 916 } |
917 | 917 |
918 return NULL; | 918 return NULL; |
919 } | 919 } |
920 | 920 |
921 | 921 |
922 void Collator::DeleteCollator(v8::Isolate* isolate, | 922 void Collator::DeleteCollator(v8::Isolate* isolate, |
923 Persistent<v8::Object>* object, | 923 Persistent<v8::Value>* object, |
924 void* param) { | 924 void* param) { |
925 // First delete the hidden C++ object. | 925 // First delete the hidden C++ object. |
926 delete reinterpret_cast<icu::Collator*>(Handle<JSObject>::cast( | 926 delete reinterpret_cast<icu::Collator*>(Handle<JSObject>::cast( |
927 v8::Utils::OpenPersistent(object))->GetInternalField(0)); | 927 v8::Utils::OpenPersistent(object))->GetInternalField(0)); |
928 | 928 |
929 // Then dispose of the persistent handle to JS object. | 929 // Then dispose of the persistent handle to JS object. |
930 object->Dispose(isolate); | 930 object->Dispose(isolate); |
931 } | 931 } |
932 | 932 |
933 } } // namespace v8::internal | 933 } } // namespace v8::internal |
OLD | NEW |