| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent f0d8743 commit 93ea166
3 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -26,7 +26,8 @@ const { | |||
| 26 | 26 | }, | |
| 27 | 27 | } = require('internal/errors'); | |
| 28 | 28 | ||
| 29 | - const { structuredClone, lazyDOMException } = require('internal/util'); | ||
| 29 | + const { structuredClone } = require('internal/structured_clone'); | ||
| 30 | + const { lazyDOMException } = require('internal/util'); | ||
| 30 | 31 | ||
| 31 | 32 | const markTimings = new SafeMap(); | |
| 32 | 33 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -477,21 +477,6 @@ const lazyDOMException = hideStackFrames((message, name) => { | |||
| 477 | 477 | return new _DOMException(message, name); | |
| 478 | 478 | }); | |
| 479 | 479 | ||
| 480 | - function structuredClone(value) { | ||
| 481 | - const { | ||
| 482 | - DefaultSerializer, | ||
| 483 | - DefaultDeserializer, | ||
| 484 | - } = require('v8'); | ||
| 485 | - const ser = new DefaultSerializer(); | ||
| 486 | - ser._getDataCloneError = hideStackFrames((message) => | ||
| 487 | - lazyDOMException(message, 'DataCloneError')); | ||
| 488 | - ser.writeValue(value); | ||
| 489 | - const serialized = ser.releaseBuffer(); | ||
| 490 | - | ||
| 491 | - const des = new DefaultDeserializer(serialized); | ||
| 492 | - return des.readValue(); | ||
| 493 | - } | ||
| 494 | - | ||
| 495 | 480 | module.exports = { | |
| 496 | 481 | assertCrypto, | |
| 497 | 482 | cachedResult, | |
@@ -515,7 +500,6 @@ module.exports = { | |||
| 515 | 500 | promisify, | |
| 516 | 501 | sleep, | |
| 517 | 502 | spliceOne, | |
| 518 | - structuredClone, | ||
| 519 | 503 | toUSVString, | |
| 520 | 504 | removeColors, | |
| 521 | 505 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -44,12 +44,15 @@ assert.throws(() => mark(Symbol('a')), { | |||
| 44 | 44 | assert.strictEqual(m.entryType, 'mark'); | |
| 45 | 45 | assert.strictEqual(m.detail, null); | |
| 46 | 46 | }); | |
| 47 | - [1, 'any', {}, []].forEach((detail) => { | ||
| 47 | + [1, 'any', {}, [], /a/].forEach((detail) => { | ||
| 48 | 48 | const m = mark('a', { detail }); | |
| 49 | 49 | assert.strictEqual(m.name, 'a'); | |
| 50 | 50 | assert.strictEqual(m.entryType, 'mark'); | |
| 51 | 51 | // Value of detail is structured cloned. | |
| 52 | 52 | assert.deepStrictEqual(m.detail, detail); | |
| 53 | + if (typeof detail === 'object') { | ||
| 54 | + assert.notStrictEqual(m.detail, detail); | ||
| 55 | + } | ||
| 53 | 56 | }); | |
| 54 | 57 | ||
| 55 | 58 | clearMarks(); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments