OLD | NEW |
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 Loading... |
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 Loading... |
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(); |
OLD | NEW |