Sha256: 7f0b699d58ab1f6016fcfd01caa711366c8429abc63d655d6cde58ef5d41fecf

Contents?: true

Size: 723 Bytes

Versions: 3

Compression:

Stored size: 723 Bytes

Contents

import { assert } from '@ember/debug';
import calculateLocationDisplay from '../system/calculate-location-display';
export default function errorOnInputWithContent(env) {
    let { moduleName } = env.meta;
    return {
        name: 'assert-input-helper-without-block',
        visitor: {
            BlockStatement(node) {
                if (node.path.original !== 'input') {
                    return;
                }
                assert(assertMessage(moduleName, node));
            },
        },
    };
}
function assertMessage(moduleName, node) {
    let sourceInformation = calculateLocationDisplay(moduleName, node.loc);
    return `The {{input}} helper cannot be used in block form. ${sourceInformation}`;
}

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
discourse-ember-source-3.6.0.0 dist/es/ember-template-compiler/lib/plugins/assert-input-helper-without-block.js
discourse-ember-source-3.5.1.1 dist/es/ember-template-compiler/lib/plugins/assert-input-helper-without-block.js
discourse-ember-source-3.5.1.0 dist/dist/es/ember-template-compiler/lib/plugins/assert-input-helper-without-block.js