mirror of
				https://github.com/LadybirdBrowser/ladybird.git
				synced 2025-11-03 23:00:58 +00:00 
			
		
		
		
	LibJS: Remove non-spec compliant code from internal_construct
It seems that we are now spec compliant enough to be able to remove this
code block :^)
Diff Tests:
    +2 ✅    -2 ❌
			
			
This commit is contained in:
		
							parent
							
								
									18d39deefe
								
							
						
					
					
						commit
						f28bb90d9b
					
				
				
				Notes:
				
					sideshowbarker
				
				2024-07-16 19:17:47 +09:00 
				
			
			Author: https://github.com/shannonbooth
Commit: f28bb90d9b
Pull-request: https://github.com/SerenityOS/serenity/pull/24449
			
					 2 changed files with 26 additions and 9 deletions
				
			
		| 
						 | 
				
			
			@ -506,15 +506,6 @@ ThrowCompletionOr<NonnullGCPtr<Object>> ECMAScriptFunctionObject::internal_const
 | 
			
		|||
 | 
			
		||||
    // 10. If result.[[Type]] is return, then
 | 
			
		||||
    if (result.type() == Completion::Type::Return) {
 | 
			
		||||
        // FIXME: This is leftover from untangling the call/construct mess - doesn't belong here in any way, but removing it breaks derived classes.
 | 
			
		||||
        // Likely fixed by making ClassDefinitionEvaluation fully spec compliant.
 | 
			
		||||
        if (kind == ConstructorKind::Derived && result.value()->is_object()) {
 | 
			
		||||
            auto prototype = TRY(new_target.get(vm.names.prototype));
 | 
			
		||||
            if (prototype.is_object())
 | 
			
		||||
                TRY(result.value()->as_object().internal_set_prototype_of(&prototype.as_object()));
 | 
			
		||||
        }
 | 
			
		||||
        // EOF (End of FIXME)
 | 
			
		||||
 | 
			
		||||
        // a. If Type(result.[[Value]]) is Object, return result.[[Value]].
 | 
			
		||||
        if (result.value()->is_object())
 | 
			
		||||
            return result.value()->as_object();
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue