Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better error explanation (line number, byte position) #122

Open
kokizzu opened this issue Sep 5, 2014 · 0 comments
Open

Better error explanation (line number, byte position) #122

kokizzu opened this issue Sep 5, 2014 · 0 comments
Labels

Comments

@kokizzu
Copy link

kokizzu commented Sep 5, 2014

For example, I had a template using this string:

<tr>
            <td>{{=1+it.no}}</td>
            {{? it.rowspan it.rowspan>0 }}<td rowspan="{{=it.rowspan}}"><textarea id="jobdesc_{{=it.no}}">{{=it.jobdesc}}</textarea></td>{{?}}
            <td><input id="aktivitas_{{=it.no}}" value="{{=it.aktivitas}}"/></td>
            <td>
                <select id="periode_{{=it.no}}" value="{{=periode[it.koef_periode]}}" onchange="row_recal({{=it.no}})" >
                    <option value="52">mingguan</option>
                    <option value="12">bulanan</option>
                    <option value="1">tahunan</option>
                </select>
            </td>
            <td><input <?=$ro?> id="koef_periode_{{=it.no}}" value="{{=it.koef_periode}}" /></td>
            <td><input type='number' style="width: 40px" id="vol_kali_{{=it.no}}" value="{{=it.vol_kali}}" onchange="recal_row({{=it.no}})" /></td>
            <td><input type='number' style="width: 40px" id="kuantitas_{{=it.no}}" value="{{=it.kuantitas}}" onchange="recal_row({{=it.no}})" /></td>
            <td><input type='number' style="width: 40px" id="waktu_proses_{{=it.no}}" value="{{=it.waktu_proses}}" onchange="recal_row({{=it.no}})" /></td>
            <td><input type='number' style="width: 60px" id="waktu_terpakai_{{=it.no}}" value="{{=it.waktu_terpakai}}" onchange="recal_row({{=it.no}})" /></td>
            <td id='fte_{{=it.no}}'>{{=it.fte}}</td>
            <td>
                {{? it.no == d.length }}
                    <input type="button" onclick="row_del({{=it.no}})" value="+" />
                {{?}}
                {{? it.no < d.length }}
                    <input type="button" onclick="row_del({{=it.no}})" value="-" />
                    <input type="button" onclick="row_move({{=it.no}},-1)" value="^" {{?? it.no==1 }}disabled='disabled'{{??}} />
                    <input type="button" onclick="row_move({{=it.no}},+1)" value="v" {{?? it.no+1==d.length }}disabled='disabled'{{??}} />
                    <input type="button" onclick="row_set({{=it.no}})" value="Set" />
                {{?}}
            </td>
        </tr>

There error would be:

Could not create a template function: var out=' <tr> <td>'+(1+it.no)+'</td><td rowspan="'+(it.rowspan)+'"><textarea id="jobdesc_'+(it.no)+'">'+(it.jobdesc)+'</textarea></td><td><input id="aktivitas_'+(it.no)+'" value="'+(it.aktivitas)+'"></td> <td> <select id="periode_'+(it.no)+'" value="'+(periode[it.koef_periode])+'" onchange="row_recal('+(it.no)+')"> <option value="52">mingguan</option> <option value="12">bulanan</option> <option value="1">tahunan</option> </select> </td> <td><input id="koef_periode_'+(it.no)+'" value="'+(it.koef_periode)+'"></td> <td><input type="number" style="width: 40px" id="vol_kali_'+(it.no)+'" value="'+(it.vol_kali)+'" onchange="recal_row('+(it.no)+')"></td> <td><input type="number" style="width: 40px" id="kuantitas_'+(it.no)+'" value="'+(it.kuantitas)+'" onchange="recal_row('+(it.no)+')"></td> <td><input type="number" style="width: 40px" id="waktu_proses_'+(it.no)+'" value="'+(it.waktu_proses)+'" onchange="recal_row('+(it.no)+')"></td> <td><input type="number" style="width: 60px" id="waktu_terpakai_'+(it.no)+'" value="'+(it.waktu_terpakai)+'" onchange="recal_row('+(it.no)+')"></td> <td id="fte_'+(it.no)+'">'+(it.fte)+'</td> <td> ';if(it.no == d.length){out+=' <input type="button" onclick="row_del('+(it.no)+')" value="+"> ';}out+=' ';if(it.no &lt; d.length){out+=' <input type="button" onclick="row_del('+(it.no)+')" value="-"> <input type="button" onclick="row_move('+(it.no)+',-1)" value="^" ';}else if(="" it.no="=1"){out+='disabled="disabled" ';}else{out+='=""> <input type="button" onclick="row_move('+(it.no)+',+1)" value="v" ';}else if(="" it.no+1="=d.length"){out+='disabled="disabled" ';}else{out+='=""> <input type="button" onclick="row_set('+(it.no)+')" value="Set"> ';}out+=' </td> </tr> ';return out; 

It took time to comprehend which part of the string that gives error '___')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants