| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 9e9d499 commit d3f0a6a
3 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -11,7 +11,7 @@ | |||
| 11 | 11 | #define V8_MAJOR_VERSION 5 | |
| 12 | 12 | #define V8_MINOR_VERSION 0 | |
| 13 | 13 | #define V8_BUILD_NUMBER 71 | |
| 14 | - #define V8_PATCH_LEVEL 55 | ||
| 14 | + #define V8_PATCH_LEVEL 56 | ||
| 15 | 15 | ||
| 16 | 16 | // Use 1 for candidates and 0 otherwise. | |
| 17 | 17 | // (Boolean macro values are not supported by all preprocessors.) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1494,6 +1494,12 @@ PropertyMirror.prototype.name = function() { | |||
| 1494 | 1494 | }; | |
| 1495 | 1495 | ||
| 1496 | 1496 | ||
| 1497 | + PropertyMirror.prototype.toText = function() { | ||
| 1498 | + if (IS_SYMBOL(this.name_)) return %SymbolDescriptiveString(this.name_); | ||
| 1499 | + return this.name_; | ||
| 1500 | + }; | ||
| 1501 | + | ||
| 1502 | + | ||
| 1497 | 1503 | PropertyMirror.prototype.isIndexed = function() { | |
| 1498 | 1504 | for (var i = 0; i < this.name_.length; i++) { | |
| 1499 | 1505 | if (this.name_[i] < '0' || '9' < this.name_[i]) { | |
@@ -2054,10 +2060,10 @@ FrameMirror.prototype.invocationText = function() { | |||
| 2054 | 2060 | if (display_receiver) { | |
| 2055 | 2061 | result += '.'; | |
| 2056 | 2062 | } | |
| 2057 | - result += property.name(); | ||
| 2063 | + result += property.toText(); | ||
| 2058 | 2064 | } else { | |
| 2059 | 2065 | result += '['; | |
| 2060 | - result += property.name(); | ||
| 2066 | + result += property.toText(); | ||
| 2061 | 2067 | result += ']'; | |
| 2062 | 2068 | } | |
| 2063 | 2069 | // Also known as - if the name in the function doesn't match the name | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -35,7 +35,8 @@ function Point(x, y) { | |||
| 35 | 35 | ||
| 36 | 36 | Point.prototype.distanceTo = function(p) { | |
| 37 | 37 | debugger; | |
| 38 | - return Math.sqrt(Math.pow(Math.abs(this.x - p.x), 2) + Math.pow(Math.abs(this.y - p.y), 2)) | ||
| 38 | + return Math.sqrt(Math.pow(Math.abs(this.x - p.x), 2) + | ||
| 39 | + Math.pow(Math.abs(this.y - p.y), 2)) | ||
| 39 | 40 | } | |
| 40 | 41 | ||
| 41 | 42 | p1 = new Point(1,1); | |
@@ -58,7 +59,7 @@ a=[1,2,distance]; | |||
| 58 | 59 | // Get the Debug object exposed from the debug context global object. | |
| 59 | 60 | Debug = debug.Debug | |
| 60 | 61 | ||
| 61 | - testConstructor = false; // Flag to control which part of the test is run. | ||
| 62 | + what = 'constructor'; // Flag to control which part of the test is run. | ||
| 62 | 63 | listenerCalled = false; | |
| 63 | 64 | exception = false; | |
| 64 | 65 | ||
@@ -72,30 +73,47 @@ function safeEval(code) { | |||
| 72 | 73 | ||
| 73 | 74 | function listener(event, exec_state, event_data, data) { | |
| 74 | 75 | try { | |
| 75 | - if (event == Debug.DebugEvent.Break) | ||
| 76 | - { | ||
| 77 | - if (!testConstructor) { | ||
| 78 | - // The expected backtrace is | ||
| 79 | - // 0: Call distance on Point where distance is a property on the prototype | ||
| 80 | - // 1: Call distance on Point where distance is a direct property | ||
| 81 | - // 2: Call on function an array element 2 | ||
| 82 | - // 3: [anonymous] | ||
| 83 | - assertEquals("#<Point>.distanceTo(p=#<Point>)", exec_state.frame(0).invocationText()); | ||
| 84 | - assertEquals("#<Point>.distanceTo(p=#<Point>)", exec_state.frame(1).invocationText()); | ||
| 85 | - assertEquals("#<Array>[2](aka distance)(p=#<Point>, q=#<Point>)", exec_state.frame(2).invocationText()); | ||
| 86 | - assertEquals("[anonymous]()", exec_state.frame(3).invocationText()); | ||
| 87 | - listenerCalled = true; | ||
| 88 | - } else { | ||
| 89 | - // The expected backtrace is | ||
| 90 | - // 0: Call Point constructor | ||
| 91 | - // 1: Call on global function createPoint | ||
| 92 | - // 2: [anonymous] | ||
| 93 | - assertEquals("new Point(x=0, y=0)", exec_state.frame(0).invocationText()); | ||
| 94 | - assertEquals("createPoint(x=0, y=0)", exec_state.frame(1).invocationText()); | ||
| 95 | - assertEquals("[anonymous]()", exec_state.frame(2).invocationText()); | ||
| 96 | - listenerCalled = true; | ||
| 76 | + if (event == Debug.DebugEvent.Break) { | ||
| 77 | + if (what == 'constructor') { | ||
| 78 | + // The expected backtrace is | ||
| 79 | + // 0: Call distance on Point where distance is a prototype property | ||
| 80 | + // 1: Call distance on Point where distance is a direct property | ||
| 81 | + // 2: Call on function an array element 2 | ||
| 82 | + // 3: [anonymous] | ||
| 83 | + assertEquals("#<Point>.distanceTo(p=#<Point>)", | ||
| 84 | + exec_state.frame(0).invocationText()); | ||
| 85 | + assertEquals("#<Point>.distanceTo(p=#<Point>)", | ||
| 86 | + exec_state.frame(1).invocationText()); | ||
| 87 | + assertEquals("#<Array>[2](aka distance)(p=#<Point>, q=#<Point>)", | ||
| 88 | + exec_state.frame(2).invocationText()); | ||
| 89 | + assertEquals("[anonymous]()", exec_state.frame(3).invocationText()); | ||
| 90 | + listenerCalled = true; | ||
| 91 | + } else if (what == 'breakpoint') { | ||
| 92 | + // The expected backtrace is | ||
| 93 | + // 0: Call Point constructor | ||
| 94 | + // 1: Call on global function createPoint | ||
| 95 | + // 2: [anonymous] | ||
| 96 | + assertEquals("new Point(x=0, y=0)", | ||
| 97 | + exec_state.frame(0).invocationText()); | ||
| 98 | + assertEquals("createPoint(x=0, y=0)", | ||
| 99 | + exec_state.frame(1).invocationText()); | ||
| 100 | + assertEquals("[anonymous]()", exec_state.frame(2).invocationText()); | ||
| 101 | + listenerCalled = true; | ||
| 102 | + } else if (what == 'symbol') { | ||
| 103 | + // The expected backtrace is | ||
| 104 | + // 0: Call Point constructor | ||
| 105 | + // 1: Call on symbol method | ||
| 106 | + // 2: [anonymous] | ||
| 107 | + assertEquals("new Point(x=0, y=0)", | ||
| 108 | + exec_state.frame(0).invocationText()); | ||
| 109 | + assertEquals("#<Object>[Symbol(Das Symbol)](x=0, y=0)", | ||
| 110 | + exec_state.frame(1).invocationText()); | ||
| 111 | + assertEquals("[anonymous]()", exec_state.frame(2).invocationText()); | ||
| 112 | + listenerCalled = true; | ||
| 113 | + } else { | ||
| 114 | + assertUnreachable(); | ||
| 115 | + } | ||
| 97 | 116 | } | |
| 98 | - } | ||
| 99 | 117 | } catch (e) { | |
| 100 | 118 | exception = e | |
| 101 | 119 | }; | |
@@ -112,11 +130,21 @@ assertTrue(listenerCalled); | |||
| 112 | 130 | assertFalse(exception, "exception in listener") | |
| 113 | 131 | ||
| 114 | 132 | // Set a break point and call to invoke the debug event listener. | |
| 133 | + what = 'breakpoint'; | ||
| 115 | 134 | listenerCalled = false; | |
| 116 | - testConstructor = true; | ||
| 117 | 135 | Debug.setBreakPoint(Point, 0, 0); | |
| 118 | 136 | createPoint(0, 0); | |
| 119 | 137 | ||
| 120 | 138 | // Make sure that the debug event listener vas invoked (again). | |
| 121 | 139 | assertTrue(listenerCalled); | |
| 122 | 140 | assertFalse(exception, "exception in listener") | |
| 141 | + | ||
| 142 | + what = 'symbol'; | ||
| 143 | + listenerCalled = false; | ||
| 144 | + var S = Symbol('Das Symbol'); | ||
| 145 | + var o = { [S](x, y) { return new Point(x, y); } }; | ||
| 146 | + Debug.setBreakPoint(Point, 0, 0); | ||
| 147 | + o[S](0, 0); | ||
| 148 | + | ||
| 149 | + assertTrue(listenerCalled); | ||
| 150 | + assertFalse(exception, "exception in listener") | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments