| 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 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 287 | 287 |
| 288 | 288 |
| 289 // ECMA-262, section 11.10, page 57. | 289 // ECMA-262, section 11.10, page 57. |
| 290 function BIT_XOR(y) { | 290 function BIT_XOR(y) { |
| 291 var x = IS_NUMBER(this) ? this : %NonNumberToNumber(this); | 291 var x = IS_NUMBER(this) ? this : %NonNumberToNumber(this); |
| 292 if (!IS_NUMBER(y)) y = %NonNumberToNumber(y); | 292 if (!IS_NUMBER(y)) y = %NonNumberToNumber(y); |
| 293 return %NumberXor(x, y); | 293 return %NumberXor(x, y); |
| 294 } | 294 } |
| 295 | 295 |
| 296 | 296 |
| 297 // ECMA-262, section 11.4.7, page 47. | |
| 298 function UNARY_MINUS() { | |
| 299 var x = IS_NUMBER(this) ? this : %NonNumberToNumber(this); | |
| 300 return %NumberUnaryMinus(x); | |
| 301 } | |
| 302 | |
| 303 | |
| 304 // ECMA-262, section 11.4.8, page 48. | 297 // ECMA-262, section 11.4.8, page 48. |
| 305 function BIT_NOT() { | 298 function BIT_NOT() { |
| 306 var x = IS_NUMBER(this) ? this : %NonNumberToNumber(this); | 299 var x = IS_NUMBER(this) ? this : %NonNumberToNumber(this); |
| 307 return %NumberNot(x); | 300 return %NumberNot(x); |
| 308 } | 301 } |
| 309 | 302 |
| 310 | 303 |
| 311 // ECMA-262, section 11.7.1, page 51. | 304 // ECMA-262, section 11.7.1, page 51. |
| 312 function SHL(y) { | 305 function SHL(y) { |
| 313 var x = IS_NUMBER(this) ? this : %NonNumberToNumber(this); | 306 var x = IS_NUMBER(this) ? this : %NonNumberToNumber(this); |
| (...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 681 return i; | 674 return i; |
| 682 } | 675 } |
| 683 | 676 |
| 684 | 677 |
| 685 // NOTE: Setting the prototype for Array must take place as early as | 678 // NOTE: Setting the prototype for Array must take place as early as |
| 686 // possible due to code generation for array literals. When | 679 // possible due to code generation for array literals. When |
| 687 // generating code for a array literal a boilerplate array is created | 680 // generating code for a array literal a boilerplate array is created |
| 688 // that is cloned when running the code. It is essential that the | 681 // that is cloned when running the code. It is essential that the |
| 689 // boilerplate gets the right prototype. | 682 // boilerplate gets the right prototype. |
| 690 %FunctionSetPrototype($Array, new $Array(0)); | 683 %FunctionSetPrototype($Array, new $Array(0)); |
| OLD | NEW |