Skip to content

Commit

Permalink
NodeJS events are simple objects
Browse files Browse the repository at this point in the history
  • Loading branch information
zloirock committed Nov 22, 2021
1 parent 3177634 commit 817055e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 3 additions & 2 deletions tests/pure/web.structured-clone.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Originally from: https://github.com/web-platform-tests/wpt/blob/4b35e758e2fc4225368304b02bcec9133965fd1a/IndexedDB/structured-clone.any.js
// Copyright © web-platform-tests contributors. Available under the 3-Clause BSD License.
/* eslint-disable es/no-typed-arrays -- safe */
import { GLOBAL } from '../helpers/constants';
import { GLOBAL, NODE } from '../helpers/constants';
import { fromSource } from '../helpers/helpers';

import structuredClone from 'core-js-pure/stable/structured-clone';
Expand Down Expand Up @@ -412,7 +412,8 @@ QUnit.module('structuredClone', () => {
const event = fromSource('new Event("")');
const channel = fromSource('new MessageChannel');

if (event) nons.push(event);
// NodeJS events are simple objects
if (event && !NODE) nons.push(event);
if (channel) nons.push(channel);

for (const it of nons) {
Expand Down
3 changes: 2 additions & 1 deletion tests/tests/web.structured-clone.js
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,8 @@ QUnit.module('structuredClone', () => {
const event = fromSource('new Event("")');
const channel = fromSource('new MessageChannel');

if (event) nons.push(event);
// NodeJS events are simple objects
if (event && !NODE) nons.push(event);
if (channel) nons.push(channel);

for (const it of nons) {
Expand Down

0 comments on commit 817055e

Please sign in to comment.