Changeset 181516 in webkit
- Timestamp:
- Mar 15, 2015, 5:16:30 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/inspector/model/remote-object-expected.txt (modified) (6 diffs)
-
LayoutTests/inspector/model/remote-object.html (modified) (3 diffs)
-
Source/JavaScriptCore/ChangeLog (modified) (1 diff)
-
Source/JavaScriptCore/inspector/InjectedScriptSource.js (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r181515 r181516 1 2015-03-15 Joseph Pecoraro <pecoraro@apple.com> 2 3 Web Inspector: Better handle displaying -0 4 https://bugs.webkit.org/show_bug.cgi?id=142708 5 6 Reviewed by Timothy Hatcher. 7 8 Add tests for -0 in different places. 9 I don't understand yet why the test says "0" for 10 the property previews of "-0". Everything behaves 11 correctly, but I can't see to make the test show 12 the right value appear in the test. That is worth 13 investigating separately though. 14 15 * inspector/model/remote-object-expected.txt: 16 * inspector/model/remote-object.html: 17 1 18 2015-03-15 Simon Fraser <simon.fraser@apple.com> 2 19 -
trunk/LayoutTests/inspector/model/remote-object-expected.txt
r181203 r181516 60 60 { 61 61 "_type": "number", 62 "_description": " 0",62 "_description": "-0", 63 63 "_value": 0 64 64 } … … 137 137 138 138 ----------------------------------------------------- 139 EXPRESSION: -Infinity 140 { 141 "_type": "number", 142 "_description": "-Infinity", 143 "_value": null 144 } 145 146 ----------------------------------------------------- 139 147 EXPRESSION: '' 140 148 { … … 533 541 534 542 ----------------------------------------------------- 535 EXPRESSION: [ 1, 2]543 EXPRESSION: [0, -0, 1, 2] 536 544 { 537 545 "_type": "object", … … 539 547 "_objectId": "<filtered>", 540 548 "_description": "Array", 541 "_size": 2,549 "_size": 4, 542 550 "_preview": { 543 551 "_type": "object", … … 546 554 "_lossless": true, 547 555 "_overflow": false, 548 "_size": 2,556 "_size": 4, 549 557 "_properties": [ 550 558 { 551 559 "_name": "0", 552 560 "_type": "number", 553 "_value": " 1"561 "_value": "0" 554 562 }, 555 563 { 556 564 "_name": "1", 565 "_type": "number", 566 "_value": "0" 567 }, 568 { 569 "_name": "2", 570 "_type": "number", 571 "_value": "1" 572 }, 573 { 574 "_name": "3", 557 575 "_type": "number", 558 576 "_value": "2" … … 1460 1478 "_type": "number", 1461 1479 "_value": "1" 1480 } 1481 ], 1482 "_entries": null 1483 } 1484 } 1485 1486 ----------------------------------------------------- 1487 EXPRESSION: ({a: 1, b: 0, c: -0}) 1488 { 1489 "_type": "object", 1490 "_objectId": "<filtered>", 1491 "_description": "Object", 1492 "_preview": { 1493 "_type": "object", 1494 "_description": "Object", 1495 "_lossless": true, 1496 "_overflow": false, 1497 "_properties": [ 1498 { 1499 "_name": "a", 1500 "_type": "number", 1501 "_value": "1" 1502 }, 1503 { 1504 "_name": "b", 1505 "_type": "number", 1506 "_value": "0" 1507 }, 1508 { 1509 "_name": "c", 1510 "_type": "number", 1511 "_value": "0" 1462 1512 } 1463 1513 ], -
trunk/LayoutTests/inspector/model/remote-object.html
r181203 r181516 37 37 {expression: "NaN"}, 38 38 {expression: "Infinity"}, 39 {expression: "-Infinity"}, 39 40 40 41 // Strings … … 72 73 // Array 73 74 {expression: "[]"}, 74 {expression: "[ 1, 2]"},75 {expression: "[0, -0, 1, 2]"}, 75 76 {expression: "[[1],[2],[3]]"}, 76 77 {expression: "[true, 1, 1.234, 'string', /regex/]"}, … … 89 90 {expression: "({})"}, 90 91 {expression: "({a: 1})"}, 92 {expression: "({a: 1, b: 0, c: -0})"}, 91 93 {expression: "({a: 1, b: \"string\", c: /regex/, d: Symbol('sym')})"}, 92 94 {expression: "({a:function a(){}, b:function b(){}, get getter(){}, set setter(v){}})"}, -
trunk/Source/JavaScriptCore/ChangeLog
r181503 r181516 1 2015-03-15 Joseph Pecoraro <pecoraro@apple.com> 2 3 Web Inspector: Better handle displaying -0 4 https://bugs.webkit.org/show_bug.cgi?id=142708 5 6 Reviewed by Timothy Hatcher. 7 8 Modeled after a blink change: 9 10 Patch by <aandrey@chromium.org> 11 DevTools: DevTools: Show -0 for negative zero in console 12 https://src.chromium.org/viewvc/blink?revision=162605&view=revision 13 14 * inspector/InjectedScriptSource.js: 15 When creating a description string, or preview value string 16 for -0, be sure the string is "-0" and not "0". 17 1 18 2015-03-14 Ryosuke Niwa <rniwa@webkit.org> 2 19 -
trunk/Source/JavaScriptCore/inspector/InjectedScriptSource.js
r181203 r181516 40 40 } 41 41 42 function toStringDescription(obj) 43 { 44 if (obj === 0 && 1 / obj < 0) 45 return "-0"; 46 47 return toString(obj); 48 } 49 42 50 function isUInt32(obj) 43 51 { … … 425 433 var remoteObject = this._wrapObject(value, objectGroup); 426 434 try { 427 remoteObject.description = toString (value);435 remoteObject.description = toStringDescription(value); 428 436 } catch (e) {} 429 437 return { … … 896 904 // Provide user-friendly number values. 897 905 if (this.type === "number") 898 this.description = object + "";906 this.description = toStringDescription(object); 899 907 return; 900 908 } … … 1057 1065 preview.lossless = false; 1058 1066 } 1059 this._appendPropertyPreview(preview, internal, {name, type, value: toString (value)}, propertiesThreshold);1067 this._appendPropertyPreview(preview, internal, {name, type, value: toStringDescription(value)}, propertiesThreshold); 1060 1068 continue; 1061 1069 }
Note:
See TracChangeset
for help on using the changeset viewer.