/*
 * Copyright (c) 2018, 2026, Oracle and/or its affiliates.
 * Licensed under The Universal Permissive License (UPL), Version 1.0
 * as shown at https://oss.oracle.com/licenses/upl/
 */
const RULENAME="oj-html-attr-expr-writeback";const SHORT="An attribute expression uses write-back syntax (\"{{...}}\" but the attribute metadata does not support write-back.";const LONG=SHORT+"\n"+"Note that although technically incorrect, functionally there is no harm incurred by using the wrong style of binding notation for a read-only property "+"except for a theoretical performance penalty (minimal).";class Rule{getName(){return RULENAME}getDescription(){return LONG}getShortDescription(){return SHORT}register(regCtx){this._metaLib=regCtx.utils.metaLib;return{attrexpr:this._onExpr}}_onExpr(ruleCtx,attrib,attrValue){var tag=ruleCtx.tagNode.name;if(this._metaLib.isTagAttr(tag,attrib)){if(attrValue.startsWith("{")){if(!ruleCtx.utils.metaLib.isTagAttrWriteback(tag,attrib)){let issue=new ruleCtx.Issue(`<${tag}> attribute '${attrib}' uses a writeback expression, but attribute writeback is not enabled. Replace with "[[ . . .]]"`);ruleCtx.reporter.addIssue(issue,ruleCtx)}}}}}module.exports=Rule;