mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 07:02:44 +00:00 
			
		
		
		
	LibJS: Convert Intl::DateTimeFormatFunction::create() to NonnullGCPtr
This commit is contained in:
		
							parent
							
								
									46acce5142
								
							
						
					
					
						commit
						81d5bbcb04
					
				
					 3 changed files with 4 additions and 4 deletions
				
			
		|  | @ -14,9 +14,9 @@ | |||
| namespace JS::Intl { | ||||
| 
 | ||||
| // 11.5.5 DateTime Format Functions, https://tc39.es/ecma402/#sec-datetime-format-functions
 | ||||
| DateTimeFormatFunction* DateTimeFormatFunction::create(Realm& realm, DateTimeFormat& date_time_format) | ||||
| NonnullGCPtr<DateTimeFormatFunction> DateTimeFormatFunction::create(Realm& realm, DateTimeFormat& date_time_format) | ||||
| { | ||||
|     return realm.heap().allocate<DateTimeFormatFunction>(realm, date_time_format, *realm.intrinsics().function_prototype()); | ||||
|     return *realm.heap().allocate<DateTimeFormatFunction>(realm, date_time_format, *realm.intrinsics().function_prototype()); | ||||
| } | ||||
| 
 | ||||
| DateTimeFormatFunction::DateTimeFormatFunction(DateTimeFormat& date_time_format, Object& prototype) | ||||
|  |  | |||
|  | @ -16,7 +16,7 @@ class DateTimeFormatFunction final : public NativeFunction { | |||
|     JS_OBJECT(DateTimeFormatFunction, NativeFunction); | ||||
| 
 | ||||
| public: | ||||
|     static DateTimeFormatFunction* create(Realm&, DateTimeFormat&); | ||||
|     static NonnullGCPtr<DateTimeFormatFunction> create(Realm&, DateTimeFormat&); | ||||
| 
 | ||||
|     virtual ~DateTimeFormatFunction() override = default; | ||||
|     virtual void initialize(Realm&) override; | ||||
|  |  | |||
|  | @ -52,7 +52,7 @@ JS_DEFINE_NATIVE_FUNCTION(DateTimeFormatPrototype::format) | |||
|     if (!date_time_format->bound_format()) { | ||||
|         // a. Let F be a new built-in function object as defined in DateTime Format Functions (11.1.6).
 | ||||
|         // b. Set F.[[DateTimeFormat]] to dtf.
 | ||||
|         auto* bound_format = DateTimeFormatFunction::create(realm, *date_time_format); | ||||
|         auto bound_format = DateTimeFormatFunction::create(realm, *date_time_format); | ||||
| 
 | ||||
|         // c. Set dtf.[[BoundFormat]] to F.
 | ||||
|         date_time_format->set_bound_format(bound_format); | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Linus Groh
						Linus Groh