<commit_before>var clipper = require('../lib/clipper');

var SCALE = 100;

var PolygonSet = function(polygons) {
  polygons.__proto__ = PolygonSet.prototype;
  return polygons;
};

PolygonSet.prototype = [];

// Merges the polygons in the polygon set.
PolygonSet.prototype.merge = function() {
  var cpr = new clipper.Clipper(),
      solutionPaths = [];

  var subjectPaths = this.map(function(polygon) {
    var path = polygon.map(function(vertex) {
      return {X: vertex[0], Y: vertex[1]};
    });

    clipper.JS.ScaleUpPath(path, SCALE);

    return path;
  });

  cpr.AddPaths(subjectPaths, clipper.PolyType.ptSubject, true);
<commit_msg>Change PolygonSet to not inherit from array.<commit_after>var clipper = require('../lib/clipper');

var SCALE = 100;

var PolygonSet = function(polygons) {
  this.polygons = polygons;
};

PolygonSet.prototype.constructor = PolygonSet;

// Merges the polygons in the polygon set.
PolygonSet.prototype.merge = function() {
  var cpr = new clipper.Clipper(),
      solutionPaths = [];

  var subjectPaths = this.polygons.map(function(polygon) {
    var path = polygon.map(function(vertex) {
      return {X: vertex[0], Y: vertex[1]};
    });

    clipper.JS.ScaleUpPath(path, SCALE);

    return path;
  });

  cpr.AddPaths(subjectPaths, clipper.PolyType.ptSubject, true);

{'fraction_non_alphanumeric': 0.13905775075987842, 'fraction_numerical': 0.007598784194528876, 'mean_word_length': 3.8241758241758244, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '6467556', 'n_tokens_mistral': 460, 'n_tokens_neox': 439, 'n_words': 97}