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

Side by Side Diff: src/mirror-debugger.js

Issue 27491002: Cosmetic: Add macros for NaN, undefined and Infinity to native js code. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 2 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/messages.js ('k') | src/object-observe.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-2012 the V8 project authors. All rights reserved. 1 // Copyright 2006-2012 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 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 return mirror_cache_[handle]; 110 return mirror_cache_[handle];
111 } 111 }
112 112
113 113
114 /** 114 /**
115 * Returns the mirror for the undefined value. 115 * Returns the mirror for the undefined value.
116 * 116 *
117 * @returns {Mirror} the mirror reflects the undefined value 117 * @returns {Mirror} the mirror reflects the undefined value
118 */ 118 */
119 function GetUndefinedMirror() { 119 function GetUndefinedMirror() {
120 return MakeMirror(void 0); 120 return MakeMirror(UNDEFINED);
121 } 121 }
122 122
123 123
124 /** 124 /**
125 * Inherit the prototype methods from one constructor into another. 125 * Inherit the prototype methods from one constructor into another.
126 * 126 *
127 * The Function.prototype.inherits from lang.js rewritten as a standalone 127 * The Function.prototype.inherits from lang.js rewritten as a standalone
128 * function (not on Function.prototype). NOTE: If this file is to be loaded 128 * function (not on Function.prototype). NOTE: If this file is to be loaded
129 * during bootstrapping this function needs to be revritten using some native 129 * during bootstrapping this function needs to be revritten using some native
130 * functions as prototype setup using normal JavaScript does not work as 130 * functions as prototype setup using normal JavaScript does not work as
(...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after
475 return this.value_; 475 return this.value_;
476 }; 476 };
477 477
478 478
479 /** 479 /**
480 * Mirror object for Undefined. 480 * Mirror object for Undefined.
481 * @constructor 481 * @constructor
482 * @extends ValueMirror 482 * @extends ValueMirror
483 */ 483 */
484 function UndefinedMirror() { 484 function UndefinedMirror() {
485 %_CallFunction(this, UNDEFINED_TYPE, void 0, ValueMirror); 485 %_CallFunction(this, UNDEFINED_TYPE, UNDEFINED, ValueMirror);
486 } 486 }
487 inherits(UndefinedMirror, ValueMirror); 487 inherits(UndefinedMirror, ValueMirror);
488 488
489 489
490 UndefinedMirror.prototype.toText = function() { 490 UndefinedMirror.prototype.toText = function() {
491 return 'undefined'; 491 return 'undefined';
492 }; 492 };
493 493
494 494
495 /** 495 /**
(...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after
950 if (this.resolved()) { 950 if (this.resolved()) {
951 return %GetFunctionScopeCount(this.value()); 951 return %GetFunctionScopeCount(this.value());
952 } else { 952 } else {
953 return 0; 953 return 0;
954 } 954 }
955 }; 955 };
956 956
957 957
958 FunctionMirror.prototype.scope = function(index) { 958 FunctionMirror.prototype.scope = function(index) {
959 if (this.resolved()) { 959 if (this.resolved()) {
960 return new ScopeMirror(void 0, this, index); 960 return new ScopeMirror(UNDEFINED, this, index);
961 } 961 }
962 }; 962 };
963 963
964 964
965 FunctionMirror.prototype.toText = function() { 965 FunctionMirror.prototype.toText = function() {
966 return this.source(); 966 return this.source();
967 }; 967 };
968 968
969 969
970 /** 970 /**
(...skipping 692 matching lines...) Expand 10 before | Expand all | Expand 10 after
1663 } 1663 }
1664 }; 1664 };
1665 1665
1666 1666
1667 FrameMirror.prototype.scopeCount = function() { 1667 FrameMirror.prototype.scopeCount = function() {
1668 return this.details_.scopeCount(); 1668 return this.details_.scopeCount();
1669 }; 1669 };
1670 1670
1671 1671
1672 FrameMirror.prototype.scope = function(index) { 1672 FrameMirror.prototype.scope = function(index) {
1673 return new ScopeMirror(this, void 0, index); 1673 return new ScopeMirror(this, UNDEFINED, index);
1674 }; 1674 };
1675 1675
1676 1676
1677 FrameMirror.prototype.stepInPositions = function() { 1677 FrameMirror.prototype.stepInPositions = function() {
1678 var script = this.func().script(); 1678 var script = this.func().script();
1679 var funcOffset = this.func().sourcePosition_(); 1679 var funcOffset = this.func().sourcePosition_();
1680 1680
1681 var stepInRaw = this.details_.stepInPositionsImpl(); 1681 var stepInRaw = this.details_.stepInPositionsImpl();
1682 var result = []; 1682 var result = [];
1683 if (stepInRaw) { 1683 if (stepInRaw) {
(...skipping 960 matching lines...) Expand 10 before | Expand all | Expand 10 after
2644 } 2644 }
2645 if (!NUMBER_IS_FINITE(value)) { 2645 if (!NUMBER_IS_FINITE(value)) {
2646 if (value > 0) { 2646 if (value > 0) {
2647 return 'Infinity'; 2647 return 'Infinity';
2648 } else { 2648 } else {
2649 return '-Infinity'; 2649 return '-Infinity';
2650 } 2650 }
2651 } 2651 }
2652 return value; 2652 return value;
2653 } 2653 }
OLDNEW
« no previous file with comments | « src/messages.js ('k') | src/object-observe.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698