| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 %SetProperty(prototype, fields[i], void 0, DONT_ENUM | DONT_DELETE); | 90 %SetProperty(prototype, fields[i], void 0, DONT_ENUM | DONT_DELETE); |
| 91 } | 91 } |
| 92 } | 92 } |
| 93 for (var i = 0; i < methods.length; i += 2) { | 93 for (var i = 0; i < methods.length; i += 2) { |
| 94 var key = methods[i]; | 94 var key = methods[i]; |
| 95 var f = methods[i + 1]; | 95 var f = methods[i + 1]; |
| 96 %SetProperty(prototype, key, f, DONT_ENUM | DONT_DELETE | READ_ONLY); | 96 %SetProperty(prototype, key, f, DONT_ENUM | DONT_DELETE | READ_ONLY); |
| 97 %SetNativeFlag(f); | 97 %SetNativeFlag(f); |
| 98 } | 98 } |
| 99 prototype.__proto__ = null; | 99 prototype.__proto__ = null; |
| 100 %PreventExtensions(prototype); | |
| 101 %ToFastProperties(prototype); | 100 %ToFastProperties(prototype); |
| 102 | |
| 103 var desc = GetOwnProperty(constructor, "prototype"); | |
| 104 desc.setWritable(false); | |
| 105 desc.setConfigurable(false); | |
| 106 DefineOwnProperty(constructor, "prototype", desc, false); | |
| 107 } | 101 } |
| 108 | 102 |
| 109 | 103 |
| 110 // ---------------------------------------------------------------------------- | 104 // ---------------------------------------------------------------------------- |
| 111 | 105 |
| 112 | 106 |
| 113 // ECMA 262 - 15.1.4 | 107 // ECMA 262 - 15.1.4 |
| 114 function GlobalIsNaN(number) { | 108 function GlobalIsNaN(number) { |
| 115 if (!IS_NUMBER(number)) number = NonNumberToNumber(number); | 109 if (!IS_NUMBER(number)) number = NonNumberToNumber(number); |
| 116 return NUMBER_IS_NAN(number); | 110 return NUMBER_IS_NAN(number); |
| (...skipping 1423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1540 | 1534 |
| 1541 function SetUpFunction() { | 1535 function SetUpFunction() { |
| 1542 %CheckIsBootstrapping(); | 1536 %CheckIsBootstrapping(); |
| 1543 InstallFunctions($Function.prototype, DONT_ENUM, $Array( | 1537 InstallFunctions($Function.prototype, DONT_ENUM, $Array( |
| 1544 "bind", FunctionBind, | 1538 "bind", FunctionBind, |
| 1545 "toString", FunctionToString | 1539 "toString", FunctionToString |
| 1546 )); | 1540 )); |
| 1547 } | 1541 } |
| 1548 | 1542 |
| 1549 SetUpFunction(); | 1543 SetUpFunction(); |
| OLD | NEW |