| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -18,6 +18,7 @@ const { | |||
| 18 | 18 | } = primordials; | |
| 19 | 19 | ||
| 20 | 20 | const { | |
| 21 | + assignFunctionName, | ||
| 21 | 22 | kEnumerableProperty, | |
| 22 | 23 | setOwnProperty, | |
| 23 | 24 | } = require('internal/util'); | |
@@ -121,7 +122,7 @@ ObjectSetPrototypeOf(MessagePort.prototype, NodeEventTarget.prototype); | |||
| 121 | 122 | // changing the prototype of MessagePort.prototype implicitly removed them. | |
| 122 | 123 | MessagePort.prototype.ref = MessagePortPrototype.ref; | |
| 123 | 124 | MessagePort.prototype.unref = MessagePortPrototype.unref; | |
| 124 | - MessagePort.prototype.hasRef = function() { | ||
| 125 | + MessagePort.prototype.hasRef = function hasRef() { | ||
| 125 | 126 | return !!FunctionPrototypeCall(MessagePortPrototype.hasRef, this); | |
| 126 | 127 | }; | |
| 127 | 128 | ||
@@ -131,14 +132,14 @@ ObjectDefineProperty( | |||
| 131 | 132 | kCreateEvent, | |
| 132 | 133 | { | |
| 133 | 134 | __proto__: null, | |
| 134 | - value: function(data, type) { | ||
| 135 | + value: assignFunctionName(kCreateEvent, function(data, type) { | ||
| 135 | 136 | if (type !== 'message' && type !== 'messageerror') { | |
| 136 | 137 | return ReflectApply(originalCreateEvent, this, arguments); | |
| 137 | 138 | } | |
| 138 | 139 | const ports = this[kCurrentlyReceivingPorts]; | |
| 139 | 140 | this[kCurrentlyReceivingPorts] = undefined; | |
| 140 | 141 | return lazyMessageEvent(type, { data, ports }); | |
| 141 | - }, | ||
| 142 | + }), | ||
| 142 | 143 | configurable: false, | |
| 143 | 144 | writable: false, | |
| 144 | 145 | enumerable: false, | |
@@ -179,7 +180,7 @@ ObjectDefineProperty(MessagePort.prototype, handleOnCloseSymbol, { | |||
| 179 | 180 | value: onclose, | |
| 180 | 181 | }); | |
| 181 | 182 | ||
| 182 | - MessagePort.prototype.close = function(cb) { | ||
| 183 | + MessagePort.prototype.close = function close(cb) { | ||
| 183 | 184 | if (typeof cb === 'function') | |
| 184 | 185 | this.once('close', cb); | |
| 185 | 186 | FunctionPrototypeCall(MessagePortPrototype.close, this); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments