mirror of
				https://github.com/tc39/test262.git
				synced 2025-11-04 13:44:29 +01:00 
			
		
		
		
	* [javascriptcore-test262-automation] changes from git@github.com:WebKit/webkit.git at sha 949e26452cfa153a7f4afe593da97e2fe9e1b706 on Tue Jul 03 2018 14:35:15 GMT-0400 (Eastern Daylight Time)
		
			
				
	
	
		
			30 lines
		
	
	
		
			617 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			30 lines
		
	
	
		
			617 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
function foo(o) {
 | 
						|
    return o.f + 1;
 | 
						|
}
 | 
						|
 | 
						|
Number.prototype.f = 42;
 | 
						|
 | 
						|
noInline(foo);
 | 
						|
 | 
						|
for (var i = 0; i < 100000; ++i) {
 | 
						|
    var result = foo(23);
 | 
						|
    if (result != 43)
 | 
						|
        throw "Error: bad result: " + result;
 | 
						|
    result = foo({f:25});
 | 
						|
    if (result != 26)
 | 
						|
        throw "Error: bad result: " + result;
 | 
						|
    result = foo({g:12, f:13});
 | 
						|
    if (result != 14)
 | 
						|
        throw "Error: bad result: " + result;
 | 
						|
}
 | 
						|
 | 
						|
var didThrow;
 | 
						|
try {
 | 
						|
    foo(void 0);
 | 
						|
} catch (e) {
 | 
						|
    didThrow = e;
 | 
						|
}
 | 
						|
 | 
						|
if (!didThrow || didThrow.toString().indexOf("TypeError:") != 0)
 | 
						|
    throw "Error: didn't throw or threw wrong exception: " + didThrow;
 |