<commit_before>const isNode8OrLater = Meteor.isServer &&
  parseInt(process.versions.node) >= 8;

Tinytest.add("ecmascript - runtime - template literals", (test) => {
  function dump(pieces) {
    var copy = {};
    // Can't use _.extend({}, pieces) because es5-shim adds enumerable
    // methods to Array.prototype, and _.extend has no own property check.
    _.each(_.keys(pieces), key => copy[key] = pieces[key]);
    return [copy, _.toArray(arguments).slice(1)];
  };
  const foo = 'B';
  // uses `babelHelpers.taggedTemplateLiteralLoose`
  test.equal(`\u0041${foo}C`, 'ABC');

  const expected = [{
    0: 'A',
    1: 'C',
    raw: ['\\u0041', 'C']
  }, [
    'B'
  ]];

  if (isNode8OrLater) {
    delete expected[0].raw;
  }

  test.equal(dump`\u0041${foo}C`, expected);
});

Tinytest.add("ecmascript - runtime - classes - basic", (test) => {
  {
    class Foo {
      constructor(x) {
        this.x = x;
      }
    }

    // Babel 7 no longer forbids constructor calls in loose mode.
    // test.throws(() => {
    //   Foo(); // called without `new`
    // });

    test.equal((new Foo(3)).x, 3);
  }

  {
    class Bar {
      constructor(x) {
        this.x = x;
      }
    }
    class Foo extends Bar {}

    // Babel 7 no longer forbids constructor calls in loose mode.
    // test.throws(() => {
    //   Foo(); // called without `new`
    // });<commit_msg>Tolerate non-enumerable .raw property in template tag function.<commit_after>const isNode8OrLater = Meteor.isServer &&
  parseInt(process.versions.node) >= 8;

Tinytest.add("ecmascript - runtime - template literals", (test) => {
  function dump(strings, ...expressions) {
    const copy = Object.create(null);
    Object.assign(copy, strings);
    copy.raw = strings.raw;
    return [copy, expressions];
  };

  const foo = "B";

  test.equal(`\u0041${foo}C`, "ABC");

  test.equal(dump`\u0041${foo}C`, [{
    0: "A",
    1: "C",
    raw: ["\\u0041", "C"]
  }, [
    "B"
  ]]);
});

Tinytest.add("ecmascript - runtime - classes - basic", (test) => {
  {
    class Foo {
      constructor(x) {
        this.x = x;
      }
    }

    // Babel 7 no longer forbids constructor calls in loose mode.
    // test.throws(() => {
    //   Foo(); // called without `new`
    // });

    test.equal((new Foo(3)).x, 3);
  }

  {
    class Bar {
      constructor(x) {
        this.x = x;
      }
    }
    class Foo extends Bar {}

    // Babel 7 no longer forbids constructor calls in loose mode.
    // test.throws(() => {
    //   Foo(); // called without `new`
    // });
{'fraction_non_alphanumeric': 0.18077983458054353, 'fraction_numerical': 0.01732965734541158, 'mean_word_length': 2.2647814910025708, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 14, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4423495', 'n_tokens_mistral': 929, 'n_tokens_neox': 872, 'n_words': 210}