| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2013 Google Inc. All rights reserved. | 3 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * | 8 * |
| 9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 698 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 709 if (this.type !== "undefined") | 709 if (this.type !== "undefined") |
| 710 this.value = object; | 710 this.value = object; |
| 711 | 711 |
| 712 // Null object is object with 'null' subtype. | 712 // Null object is object with 'null' subtype. |
| 713 if (object === null) | 713 if (object === null) |
| 714 this.subtype = "null"; | 714 this.subtype = "null"; |
| 715 | 715 |
| 716 // Provide user-friendly number values. | 716 // Provide user-friendly number values. |
| 717 if (this.type === "number") { | 717 if (this.type === "number") { |
| 718 this.description = toStringDescription(object); | 718 this.description = toStringDescription(object); |
| 719 // Override "value" property for values that can not be JSON-stringi
fied. | |
| 720 switch (this.description) { | 719 switch (this.description) { |
| 721 case "NaN": | 720 case "NaN": |
| 722 case "Infinity": | 721 case "Infinity": |
| 723 case "-Infinity": | 722 case "-Infinity": |
| 724 case "-0": | 723 case "-0": |
| 725 this.value = this.description; | 724 delete this.value; |
| 725 this.unserializableValue = this.description; |
| 726 break; | 726 break; |
| 727 } | 727 } |
| 728 } | 728 } |
| 729 | 729 |
| 730 return; | 730 return; |
| 731 } | 731 } |
| 732 | 732 |
| 733 if (injectedScript._shouldPassByValue(object)) { | 733 if (injectedScript._shouldPassByValue(object)) { |
| 734 this.value = object; | 734 this.value = object; |
| 735 this.subtype = injectedScript._subtype(object); | 735 this.subtype = injectedScript._subtype(object); |
| (...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1050 return string.substr(0, leftHalf) + "\u2026" + string.substr(string.
length - rightHalf, rightHalf); | 1050 return string.substr(0, leftHalf) + "\u2026" + string.substr(string.
length - rightHalf, rightHalf); |
| 1051 } | 1051 } |
| 1052 return string.substr(0, maxLength) + "\u2026"; | 1052 return string.substr(0, maxLength) + "\u2026"; |
| 1053 }, | 1053 }, |
| 1054 | 1054 |
| 1055 __proto__: null | 1055 __proto__: null |
| 1056 } | 1056 } |
| 1057 | 1057 |
| 1058 return injectedScript; | 1058 return injectedScript; |
| 1059 }) | 1059 }) |
| OLD | NEW |