<commit_before>
//*@public
/**
    The _enyo.ViewController_ is an abstract class designed
    to allow a controller to own a _view_ and designate its
    state rather than the other way around. It has the ability
    to render its _view_ into the DOM on demand.
*/
enyo.kind({
    //*@public
    name: "enyo.ViewController",
    //*@public
    kind: "enyo.Controller",
    //*@public
    /**
        The _view_ property can be assigned a string path or
        a reference to a _view_ that this controller will use
        when its _render_ or _renderInto_ methods are called.
    */
    view: null,
    //*@public
    /**
        The _renderTarget_ can be a string representation such
        as _document.body_ (a special case in JavaScript) or a
        node's id attribute e.g. `#mydiv`.
    */
    renderTarget: "document.body",
    //*@protected
    constructor: function () {
        this.inherited(arguments);
    },
    //*@protected
    create: function () {
        var view = this.view;
    },
    //*@public
    /**
        Call this method to render the selected _view_ into the
        designated _renderTarget_.
    */
    render: function () {
        var target = this.get("target");
        var ctor = this.get("viewKind");
        var view = this.view = new ctor();
        view.renderInto(target);
    },
    //*@public
    /**
        Pass this method the target node to render the _view_ into
        immediately.
    */
    renderInto: function (target) {
        this.set("renderTarget", target);
        this.render();
    },
    //*@protected
    target: enyo.Computed(function () {
        var target = this.renderTarget;
        if ("string" === typeof target) {
            if ("#" === target[0]) {
                target = target.slice(1);<commit_msg>find and instance the view before it is needed for programmatic overloads and changes<commit_after>
//*@public
/**
    The _enyo.ViewController_ is an abstract class designed
    to allow a controller to own a _view_ and designate its
    state rather than the other way around. It has the ability
    to render its _view_ into the DOM on demand.
*/
enyo.kind({
    //*@public
    name: "enyo.ViewController",
    //*@public
    kind: "enyo.Controller",
    //*@public
    /**
        The _view_ property can be assigned a string path or
        a reference to a _view_ that this controller will use
        when its _render_ or _renderInto_ methods are called.
    */
    view: null,
    //*@public
    /**
        The _renderTarget_ can be a string representation such
        as _document.body_ (a special case in JavaScript) or a
        node's id attribute e.g. `#mydiv`.
    */
    renderTarget: "document.body",
    //*@protected
    constructor: function () {
        this.inherited(arguments);
    },
    //*@protected
    create: function () {
        var ctor = this.get("viewKind");
        this.view = new ctor();
        this.inherited(arguments);
    },
    //*@public
    /**
        Call this method to render the selected _view_ into the
        designated _renderTarget_.
    */
    render: function () {
        var target = this.get("target");
        var view = this.get("view");
        view.renderInto(target);
    },
    //*@public
    /**
        Pass this method the target node to render the _view_ into
        immediately.
    */
    renderInto: function (target) {
        this.set("renderTarget", target);
        this.render();
    },
    //*@protected
    target: enyo.Computed(function () {
        var target = this.renderTarget;
        if ("string" === typeof target) {
            if ("#" === target[0]) {
                target = target.slice(1);
{'fraction_non_alphanumeric': 0.11256473153447806, 'fraction_numerical': 0.0010902153175252113, 'mean_word_length': 2.076278290025147, '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': '3287283', 'n_tokens_mistral': 1040, 'n_tokens_neox': 1033, 'n_words': 357}