mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 13:12:46 +00:00 
			
		
		
		
	LibWeb: Convert uses of cached_web_prototype to ensure_web_prototype
Once the construction of these objects is lazy, we cannot assume they exist.
This commit is contained in:
		
							parent
							
								
									af75493883
								
							
						
					
					
						commit
						c2939d58c7
					
				
					 5 changed files with 5 additions and 5 deletions
				
			
		|  | @ -23,7 +23,7 @@ void AudioConstructor::initialize(JS::Realm& realm) | |||
|     auto& vm = this->vm(); | ||||
|     NativeFunction::initialize(realm); | ||||
| 
 | ||||
|     define_direct_property(vm.names.prototype, &cached_web_prototype(realm, "HTMLAudioElement"), 0); | ||||
|     define_direct_property(vm.names.prototype, &ensure_web_prototype<Bindings::HTMLAudioElementPrototype>(realm, "HTMLAudioElement"), 0); | ||||
|     define_direct_property(vm.names.length, JS::Value(0), JS::Attribute::Configurable); | ||||
| } | ||||
| 
 | ||||
|  |  | |||
|  | @ -23,7 +23,7 @@ void ImageConstructor::initialize(JS::Realm& realm) | |||
|     auto& vm = this->vm(); | ||||
| 
 | ||||
|     NativeFunction::initialize(realm); | ||||
|     define_direct_property(vm.names.prototype, &cached_web_prototype(realm, "HTMLImageElement"), 0); | ||||
|     define_direct_property(vm.names.prototype, &ensure_web_prototype<Bindings::HTMLImageElementPrototype>(realm, "HTMLImageElement"), 0); | ||||
|     define_direct_property(vm.names.length, JS::Value(0), JS::Attribute::Configurable); | ||||
| } | ||||
| 
 | ||||
|  |  | |||
|  | @ -32,7 +32,7 @@ void LocationConstructor::initialize(JS::Realm& realm) | |||
|     auto& vm = this->vm(); | ||||
| 
 | ||||
|     NativeFunction::initialize(realm); | ||||
|     define_direct_property(vm.names.prototype, &cached_web_prototype(realm, "Location"), 0); | ||||
|     define_direct_property(vm.names.prototype, &ensure_web_prototype<Bindings::LocationPrototype>(realm, "Location"), 0); | ||||
|     define_direct_property(vm.names.length, JS::Value(0), JS::Attribute::Configurable); | ||||
| } | ||||
| 
 | ||||
|  |  | |||
|  | @ -25,7 +25,7 @@ void OptionConstructor::initialize(JS::Realm& realm) | |||
|     auto& vm = this->vm(); | ||||
| 
 | ||||
|     NativeFunction::initialize(realm); | ||||
|     define_direct_property(vm.names.prototype, &cached_web_prototype(realm, "HTMLOptionElement"), 0); | ||||
|     define_direct_property(vm.names.prototype, &ensure_web_prototype<Bindings::HTMLOptionElementPrototype>(realm, "HTMLOptionElement"), 0); | ||||
|     define_direct_property(vm.names.length, JS::Value(0), JS::Attribute::Configurable); | ||||
| } | ||||
| 
 | ||||
|  |  | |||
|  | @ -32,7 +32,7 @@ void WindowConstructor::initialize(JS::Realm& realm) | |||
|     auto& vm = this->vm(); | ||||
| 
 | ||||
|     NativeFunction::initialize(realm); | ||||
|     define_direct_property(vm.names.prototype, &cached_web_prototype(realm, "Window"), 0); | ||||
|     define_direct_property(vm.names.prototype, &ensure_web_prototype<Bindings::WindowPrototype>(realm, "Window"), 0); | ||||
|     define_direct_property(vm.names.length, JS::Value(0), JS::Attribute::Configurable); | ||||
| } | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Timothy Flynn
						Timothy Flynn