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

Unified Diff: src/mirror-delay.js

Issue 18194: Changes to the V8 debugger support which otherwise caused problems with Chrom... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 11 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/runtime.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/mirror-delay.js
===================================================================
--- src/mirror-delay.js (revision 1100)
+++ src/mirror-delay.js (working copy)
@@ -1660,7 +1660,7 @@
// mirror to the referenced mirrors.
if (reference && mirror.isValue()) {
this.add_(mirror);
- return '{ref:' + mirror.handle() + '}';
+ return '{"ref":' + mirror.handle() + '}';
}
// Collect the JSON property/value pairs in an array.
@@ -1922,7 +1922,26 @@
}
+/**
+ * Convert a number to a JSON string value. For all finite numbers the number
+ * literal representation is used. For non finite numbers NaN, Infinite and
+ * -Infinite the string representation "NaN", "Infinite" or "-Infinite"
+ * (including the quotes) is returned.
+ *
+ * @param {number} value The number value to convert to a JSON value
+ * @returns {String} JSON value
+ */
function NumberToJSON_(value) {
+ if (isNaN(value)) {
+ return '"NaN"';
+ }
+ if (!isFinite(value)) {
+ if (value > 0) {
+ return '"Infinity"';
+ } else {
+ return '"-Infinity"';
+ }
+ }
return String(value);
}
« no previous file with comments | « no previous file | src/runtime.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698