mirror of
https://github.com/marko-js/marko.git
synced 2025-12-08 19:26:05 +00:00
Marko v3: Added codegen test for scoped variables
This commit is contained in:
parent
a574a2be82
commit
214aa9bc07
5
test/fixtures/codegen/autotest/var-scoped/expected.js
vendored
Normal file
5
test/fixtures/codegen/autotest/var-scoped/expected.js
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
(function() {
|
||||
var name = "string";
|
||||
|
||||
log(name);
|
||||
}())
|
||||
13
test/fixtures/codegen/autotest/var-scoped/index.js
vendored
Normal file
13
test/fixtures/codegen/autotest/var-scoped/index.js
vendored
Normal file
@ -0,0 +1,13 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = function(builder) {
|
||||
var declarations = [
|
||||
{
|
||||
id: builder.identifier('name'),
|
||||
init: builder.literal('string')
|
||||
}
|
||||
];
|
||||
var vars = builder.vars(declarations);
|
||||
vars.appendChild(builder.functionCall(builder.identifier('log'), [ builder.identifier('name') ]));
|
||||
return vars;
|
||||
};
|
||||
Loading…
x
Reference in New Issue
Block a user