%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /home/vacivi36/vittasync.vacivitta.com.br/vittasync/node/test/parallel/
Upload File :
Create Path :
Current File : /home/vacivi36/vittasync.vacivitta.com.br/vittasync/node/test/parallel/test-worker-safe-getters.js

'use strict';

const common = require('../common');

const assert = require('assert');
const { Worker, isMainThread } = require('worker_threads');

if (isMainThread) {
  const w = new Worker(__filename, {
    stdin: true,
    stdout: true,
    stderr: true
  });

  const { stdin, stdout, stderr } = w;

  w.on('exit', common.mustCall((code) => {
    assert.strictEqual(code, 0);

    // `postMessage` should not throw after termination
    // (this mimics the browser behavior).
    w.postMessage('foobar');
    w.ref();
    w.unref();

    // Sanity check.
    assert.strictEqual(w.threadId, -1);
    assert.strictEqual(w.stdin, stdin);
    assert.strictEqual(w.stdout, stdout);
    assert.strictEqual(w.stderr, stderr);
  }));
} else {
  process.exit(0);
}

Zerion Mini Shell 1.0