Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Side by Side Diff: src/v8natives.js

Issue 7044054: Fix Array.prototype.{reduce,reduceRight} to pass undefined as receiver (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Address comments Created 9 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/preparser.cc ('k') | test/mjsunit/regress/regress-1436.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 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 574 matching lines...) Expand 10 before | Expand all | Expand 10 after
585 if (!IS_UNDEFINED(prop)) return prop; 585 if (!IS_UNDEFINED(prop)) return prop;
586 var proto = %GetPrototype(obj); 586 var proto = %GetPrototype(obj);
587 if (IS_NULL(proto)) return void 0; 587 if (IS_NULL(proto)) return void 0;
588 return GetProperty(proto, p); 588 return GetProperty(proto, p);
589 } 589 }
590 590
591 591
592 // ES5 section 8.12.6 592 // ES5 section 8.12.6
593 function HasProperty(obj, p) { 593 function HasProperty(obj, p) {
594 if (%IsJSProxy(obj)) { 594 if (%IsJSProxy(obj)) {
595 var handler = %GetHandler(obj) 595 var handler = %GetHandler(obj);
596 var has = handler.has 596 var has = handler.has;
597 if (IS_UNDEFINED(has)) has = DerivedHasTrap 597 if (IS_UNDEFINED(has)) has = DerivedHasTrap;
598 return ToBoolean(has.call(handler, obj, p)) 598 return ToBoolean(has.call(handler, obj, p));
599 } 599 }
600 var desc = GetProperty(obj, p); 600 var desc = GetProperty(obj, p);
601 return IS_UNDEFINED(desc) ? false : true; 601 return IS_UNDEFINED(desc) ? false : true;
602 } 602 }
603 603
604 604
605 // ES5 section 8.12.1. 605 // ES5 section 8.12.1.
606 function GetOwnProperty(obj, p) { 606 function GetOwnProperty(obj, p) {
607 // GetOwnProperty returns an array indexed by the constants 607 // GetOwnProperty returns an array indexed by the constants
608 // defined in macros.py. 608 // defined in macros.py.
(...skipping 777 matching lines...) Expand 10 before | Expand all | Expand 10 after
1386 // ---------------------------------------------------------------------------- 1386 // ----------------------------------------------------------------------------
1387 1387
1388 function SetupFunction() { 1388 function SetupFunction() {
1389 InstallFunctions($Function.prototype, DONT_ENUM, $Array( 1389 InstallFunctions($Function.prototype, DONT_ENUM, $Array(
1390 "bind", FunctionBind, 1390 "bind", FunctionBind,
1391 "toString", FunctionToString 1391 "toString", FunctionToString
1392 )); 1392 ));
1393 } 1393 }
1394 1394
1395 SetupFunction(); 1395 SetupFunction();
OLDNEW
« no previous file with comments | « src/preparser.cc ('k') | test/mjsunit/regress/regress-1436.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698