Skip to content

operator "===" parsed as "==" with param "=" #28

Description

@GoogleCodeExporter
What steps will reproduce the problem?
1. var tpl = new jSmart("{if $booleanFalse === false}OK{else}WRONG{/if}");
2. tpl.fetch({'booleanFlase':false});
3.

What is the expected output? What do you see instead?
Expect: "OK", 
See: TypeError: Cannot read property '0' of undefined
get stack: function () { [native code] }
message: "Cannot read property '0' of undefined"
set stack: function () { [native code] }
__proto__: Error

What version of the product are you using? On what operating system?
smart-2.9 on Ubuntu 12.04, with Google Chrome Version 28.0.1500.52

Please provide any additional information below.

Problem happens on parsing tokens[8]:             
1222: {
1223:   re: /^\s*(==|!=|===|!==)\s*/,
1224:   parse: function(e, s)
1225:   {
1226:     parseOperator(RegExp.$1, 'binary', 6, e.tree);
1227:   }
1228: }

First match is "==". If swap operators in regular expression like this
re: /^\s*(===|!==|==|!=)\s*/ then work fine.

Original issue reported on code.google.com by jeka...@gmail.com on 26 Jun 2013 at 2:59

Attachments:

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions