Skip to content

Commit

Permalink
use $event local
Browse files Browse the repository at this point in the history
  • Loading branch information
kbrsh committed Apr 28, 2019
1 parent b823ad5 commit 66a82f4
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions packages/moon/dist/moon.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
* List of global variables to ignore in expression scoping
*/

var globals = ["NaN", "event", "false", "in", "null", "this", "true", "typeof", "undefined", "window"];
var globals = ["NaN", "false", "in", "null", "this", "true", "typeof", "undefined", "window"];
/**
* Checks if a given character is a quote.
*
Expand Down Expand Up @@ -277,7 +277,7 @@
attributes[attributeKey] = attributeExpression === undefined ? attributeValue : scopeExpression(attributeExpression); // Add a wrapper function for events.

if (attributeKey[0] === "@") {
attributes[attributeKey] = "function(event){" + attributes[attributeKey] + "}";
attributes[attributeKey] = "function($event){" + attributes[attributeKey] + "}";
}
}
} // Append an opening tag token with the type, attributes, and optional
Expand Down
2 changes: 1 addition & 1 deletion packages/moon/dist/moon.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions packages/moon/src/compiler/lexer/lexer.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const expressionRE = /"[^"]*"|'[^']*'|\d+[a-zA-Z$_]\w*|\.[a-zA-Z$_]\w*|[a-zA-Z$_
/**
* List of global variables to ignore in expression scoping
*/
const globals = ["NaN", "event", "false", "in", "null", "this", "true", "typeof", "undefined", "window"];
const globals = ["NaN", "false", "in", "null", "this", "true", "typeof", "undefined", "window"];

/**
* Checks if a given character is a quote.
Expand Down Expand Up @@ -237,7 +237,7 @@ export function lex(input) {

// Add a wrapper function for events.
if (attributeKey[0] === "@") {
attributes[attributeKey] = `function(event){${attributes[attributeKey]}}`;
attributes[attributeKey] = `function($event){${attributes[attributeKey]}}`;
}
}
}
Expand Down

0 comments on commit 66a82f4

Please sign in to comment.