Skip to content

Commit

Permalink
expression undeclared variable fix
Browse files Browse the repository at this point in the history
  • Loading branch information
bodymovin committed Jan 6, 2018
1 parent 15e36b5 commit 16c2ba2
Show file tree
Hide file tree
Showing 5 changed files with 13,360 additions and 14,835 deletions.
11 changes: 11 additions & 0 deletions bundle/jsx/utils/expressionHelper.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,13 @@ var bm_expressionHelper = (function () {
}
}

function addSwitchStatement(statement) {
var i, len = statement.cases.length;
for (i = 0; i < len; i += 1) {
findUndeclaredVariables(statement.cases[i].consequent, 0, null, declared, undeclared, true);
}
}

if (!declared) {
declared = [];
}
Expand Down Expand Up @@ -199,6 +206,8 @@ var bm_expressionHelper = (function () {
addIfStatement(body[i]);
} else if (body[i].type === 'TryStatement') {
addTryStatement(body[i]);
} else if (body[i].type === 'SwitchStatement') {
addSwitchStatement(body[i]);
} else if (body[i].type === 'FunctionDeclaration') {
if (body[i].body && body[i].body.type === 'BlockStatement') {
var p = [];
Expand All @@ -214,6 +223,8 @@ var bm_expressionHelper = (function () {
if (body[i].argument && body[i].argument.type === 'CallExpression' && body[i].argument.callee.body) {
pendingBodies.push({body: body[i].argument.callee.body.body, d: declared, u: undeclared, pre: p, pos: body[i].argument.callee.body.range[0] + 1});
}
} else if (body[i].type === 'BlockStatement') {
findUndeclaredVariables(body[i].body, 0, null, declared, undeclared, true);
}
}
if (!isContinuation) {
Expand Down
2 changes: 1 addition & 1 deletion gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ var replace = require('gulp-replace');
var gzip = require('gulp-gzip');
var insert = require('gulp-insert');

var version = '5.0.6'
var version = '5.1.1'

var extensionSource = './bundle';
var extensionDestination = '../../../Users/Deeandra/AppData/Roaming/Adobe/CEP/extensions/bodymovin';
Expand Down
Loading

0 comments on commit 16c2ba2

Please sign in to comment.