<commit_before>function MovieClip() {
  Sprite.call(this);

  this._currentFrame = 0;
  this._currentFrameLabel = null;
  this._currentLabel = false;
  this._currentScene = { };
  this._displayList = null;
  this._enabled = true;
  this._frameScripts = { };
  this._frameLabels = { };
  this._framesLoaded = 1;
  this._isPlaying = true;
  this._scenes = { };
  this._timeline = null;
  this._totalFrames = 1;
  this._scenes = { };
}

MovieClip.prototype = Object.create(Sprite.prototype, {
  __class__: describeInternalProperty('flash.display.MovieClip'),

  addFrameScript: describeMethod(function () {
    var frameScripts = this._frameScripts;
    for (var i = 0, n = arguments.length; i < n; i += 2) {
      var frameNum = arguments[i];
      if (!frameScripts[frameNum])
        frameScripts[frameNum] = [];
      frameScripts[frameNum].push(arguments[i + 1]);
    }
  }),
  currentFrame: describeAccessor(function () {
    return this._currentFrame;
  }),
  currentFrameLabel: describeAccessor(function () {
    return this._currentFrameLabel;
  }),
  currentLabel: describeAccessor(function () {
    return this._currentLabel;
  }),
  currentLabels: describeAccessor(function () {
    return this._currentScene.labels;
  }),
  currentScene: describeAccessor(function () {
    return this._currentScene;
  }),
  enabled: describeAccessor(
    function () {
      return this._enabled;
    },
    function (val) {
      this._enabled = val;
    }
  ),
  framesLoaded: describeAccessor(function () {
    return this._framesLoaded;
  }),

  gotoFrame: describeMethod(function (frameNum, scene) {
    if (frameNum > this._totalFrames)
      frameNum = 1;

    if (frameNum > this.framesLoaded)
      frameNum = this.framesLoaded;

    this._currentFrame = frameNum;

    var currentDisplayList = this._currentDisplayList;
    var framePromise = this._timeline[frameNum - 1];
    var displayList = framePromise.value;

    this.$dispatchEvent('onEnterFrame');

    if (displayList === this._displayList)
      return;

    var loader = this.loaderInfo._loader;
    for (var depth in displayList) {
      var cmd = displayList[depth];
      if (cmd.symbolId) {
        var symbolClass = loader.getSymbolClassById(cmd.symbolId);
        var child = new symbolClass;
        this.addChild(child);
      }
    }

    this._displayList = displayList;

    if (frameNum in this._frameScripts) {
      var scripts = this._frameScripts[frameNum];
      for (var i = 0, n = scripts.length; i < n; i++)<commit_msg>Implement basic display list construction.<commit_after>function MovieClip() {
  Sprite.call(this);

  this._currentFrame = 0;
  this._currentFrameLabel = null;
  this._currentLabel = false;
  this._currentScene = { };
  this._displayList = null;
  this._enabled = true;
  this._frameScripts = { };
  this._frameLabels = { };
  this._framesLoaded = 1;
  this._isPlaying = true;
  this._scenes = { };
  this._timeline = null;
  this._totalFrames = 1;
  this._scenes = { };
}

MovieClip.prototype = Object.create(Sprite.prototype, {
  __class__: describeInternalProperty('flash.display.MovieClip'),

  addFrameScript: describeMethod(function () {
    var frameScripts = this._frameScripts;
    for (var i = 0, n = arguments.length; i < n; i += 2) {
      var frameNum = arguments[i];
      if (!frameScripts[frameNum])
        frameScripts[frameNum] = [];
      frameScripts[frameNum].push(arguments[i + 1]);
    }
  }),
  currentFrame: describeAccessor(function () {
    return this._currentFrame;
  }),
  currentFrameLabel: describeAccessor(function () {
    return this._currentFrameLabel;
  }),
  currentLabel: describeAccessor(function () {
    return this._currentLabel;
  }),
  currentLabels: describeAccessor(function () {
    return this._currentScene.labels;
  }),
  currentScene: describeAccessor(function () {
    return this._currentScene;
  }),
  enabled: describeAccessor(
    function () {
      return this._enabled;
    },
    function (val) {
      this._enabled = val;
    }
  ),
  framesLoaded: describeAccessor(function () {
    return this._framesLoaded;
  }),

  gotoFrame: describeMethod(function (frameNum, scene) {
    if (frameNum > this._totalFrames)
      frameNum = 1;

    if (frameNum > this.framesLoaded)
      frameNum = this.framesLoaded;

    this._currentFrame = frameNum;

    var currentDisplayList = this._displayList || { };
    var framePromise = this._timeline[frameNum - 1];
    var displayList = framePromise.value;

    //this.$dispatchEvent('onEnterFrame');

    if (displayList === currentDisplayList)
      return;

    var loader = this.loaderInfo._loader;
    for (var depth in displayList) {
      var cmd = displayList[depth];
      var timelineInfo = currentDisplayList[depth];
      if (cmd === null) {
        // REMOVE
        if (timelineInfo) {
          this.removeChild(timelineInfo.instance);
        }
        var instance = currentDisplayList[depth].instance;
      } else if (cmd.symbolId) {
        var symbolClass = loader.getSymbolClassById(cmd.symbolId);
        var instance = new symbolClass;
        if (timelineInfo) {
          // REPLACE
          var oldInstance = timelineInfo.instance;
          var index = this.getChildIndex(oldInstance);
          this.removeChildAt(index);
          instance._matrix = cmd.matrix || oldInstance._matrix;
          instance._cxform = cmd.cxform || oldInstance._cxform;
          this.addChildAt(instance, index);
        } else {
          // PLACE
          instance._matrix = cmd.matrix;
          instance._cxform = cmd.cxform;
          this.addChild(instance);
        }
        cmd.instance = instance;
      }
    }

    this._displayList = displayList;

    if (frameNum in this._frameScripts) {
      var scripts = this._frameScripts[frameNum];
      for (var i = 0, n = scripts.length; i < n; i++)
{'fraction_non_alphanumeric': 0.11929282526604874, 'fraction_numerical': 0.003089598352214212, 'mean_word_length': 2.9720518064076344, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '6935535', 'n_tokens_mistral': 1752, 'n_tokens_neox': 1702, 'n_words': 355}