public/lib/emberjs/ember.js
function(buffer) {
        // If not invoked via a triple-mustache ({{{foo}}}), escape
        // the content of the template.
        var escape = get(this, 'isEscaped');

        var shouldDisplay = get(this, 'shouldDisplayFunc');
        var preserveContext = get(this, 'preserveContext');
        var context = get(this, 'previousContext');

        var inverseTemplate = get(this, 'inverseTemplate');
        var displayTemplate = get(this, 'displayTemplate');

        var result = this.normalizedValue();

        this._lastNormalizedValue = result;

        // First, test the conditional to see if we should
        // render the template or not.
        if (shouldDisplay(result)) {
          set(this, 'template', displayTemplate);

          // If we are preserving the context (for example, if this
          // is an #if block, call the template with the same object.
          if (preserveContext) {
            set(this, '_context', context);
          } else {
          // Otherwise, determine if this is a block bind or not.
          // If so, pass the specified object to the template
            if (displayTemplate) {
              set(this, '_context', result);
            } else {
            // This is not a bind block, just push the result of the
            // expression to the render context and return.
              if (result === null || result === undefined) {
                result = "";
              } else if (!(result instanceof SafeString)) {
                result = String(result);
              }

              if (escape) { result = Handlebars.Utils.escapeExpression(result); }
              buffer.push(result);
              return;
            }
          }
        } else if (inverseTemplate) {
          set(this, 'template', inverseTemplate);

          if (preserveContext) {
            set(this, '_context', context);
          } else {
            set(this, '_context', result);
          }
        } else {
          set(this, 'template', function() { return ''; });
        }

        return this._super(buffer);
      }
function(buffer) {
        // If not invoked via a triple-mustache ({{{foo}}}), escape
        // the content of the template.
        var escape = get(this, 'isEscaped');

        var shouldDisplay = get(this, 'shouldDisplayFunc');
        var preserveContext = get(this, 'preserveContext');
        var context = get(this, 'previousContext');

        var inverseTemplate = get(this, 'inverseTemplate');
        var displayTemplate = get(this, 'displayTemplate');

        var result = this.normalizedValue();

        this._lastNormalizedValue = result;

        // First, test the conditional to see if we should
        // render the template or not.
        if (shouldDisplay(result)) {
          set(this, 'template', displayTemplate);

          // If we are preserving the context (for example, if this
          // is an #if block, call the template with the same object.
          if (preserveContext) {
            set(this, '_context', context);
          } else {
          // Otherwise, determine if this is a block bind or not.
          // If so, pass the specified object to the template
            if (displayTemplate) {
              set(this, '_context', result);
            } else {
            // This is not a bind block, just push the result of the
            // expression to the render context and return.
              if (result === null || result === undefined) {
                result = "";
              } else if (!(result instanceof SafeString)) {
                result = String(result);
              }

              if (escape) { result = Handlebars.Utils.escapeExpression(result); }
              buffer.push(result);
              return;
            }
          }
        } else if (inverseTemplate) {
          set(this, 'template', inverseTemplate);

          if (preserveContext) {
            set(this, '_context', context);
          } else {
            set(this, '_context', result);
          }
        } else {
          set(this, 'template', function() { return ''; });
        }

        return this._super(buffer);
      }
function ( buffer ) { // If not invoked via a triple-mustache ({{{foo}}}), escape // the content of the template. var escape = get ( this , 'isEscaped' ) ; var shouldDisplay = get ( this , 'shouldDisplayFunc' ) ; var preserveContext = get ( this , 'preserveContext' ) ; var context = get ( this , 'previousContext' ) ; var inverseTemplate = get ( this , 'inverseTemplate' ) ; var displayTemplate = get ( this , 'displayTemplate' ) ; var result = this . normalizedValue ( ) ; this . _lastNormalizedValue = result ; // First, test the conditional to see if we should // render the template or not. if ( shouldDisplay ( result ) ) { set ( this , 'template' , displayTemplate ) ; // If we are preserving the context (for example, if this // is an #if block, call the template with the same object. if ( preserveContext ) { set ( this , '_context' , context ) ; } else { // Otherwise, determine if this is a block bind or not. // If so, pass the specified object to the template if ( displayTemplate ) { set ( this , '_context' , result ) ; } else { // This is not a bind block, just push the result of the // expression to the render context and return. if ( result === null || result === undefined ) { result = "" ; } else if ( ! ( result instanceof SafeString ) ) { result = String ( result ) ; } if ( escape ) { result = Handlebars . Utils . escapeExpression ( result ) ; } buffer . push ( result ) ; return ; } } } else if ( inverseTemplate ) { set ( this , 'template' , inverseTemplate ) ; if ( preserveContext ) { set ( this , '_context' , context ) ; } else { set ( this , '_context' , result ) ; } } else { set ( this , 'template' , function ( ) { return '' ; } ) ; } return this . _super ( buffer ) ; }
Determines which template to invoke, sets up the correct state based on
that logic, then invokes the default `Ember.View` `render` implementation.

This method will first look up the `path` key on `pathRoot`,
then pass that value to the `shouldDisplayFunc` function. If that returns
`true,` the `displayTemplate` function will be rendered to DOM. Otherwise,
`inverseTemplate`, if specified, will be rendered.

For example, if this `Ember._HandlebarsBoundView` represented the `{{#with
foo}}` helper, it would look up the `foo` property of its context, and
`shouldDisplayFunc` would always return true. The object found by looking
up `foo` would be passed to `displayTemplate`.

@method render
@param {Ember.RenderBuffer} buffer
Determines which template to invoke sets up the correct state based on that logic then invokes the default Ember . View render implementation .