Skip to content

Commit

Permalink
Fix some closure compiler warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
akreuzkamp committed Mar 5, 2014
1 parent a99ff23 commit 4ef79bb
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
10 changes: 5 additions & 5 deletions src/parser.js
@@ -1,4 +1,4 @@
/* @license
/** @license
Copyright (c) 2010 Mihai Bazon <mihai.bazon@gmail.com>
Copyright (c) 2011 Lauri Paimen <lauri@paimen.info>
Expand Down Expand Up @@ -1508,11 +1508,11 @@ var warn = function() {};
* @return {Object} Object representing the binding
*/
function QMLBinding(val, tree) {
// this.function states whether the binding is a simple js statement or a function containing a
// return statement. We decide this on whether it is a code block or not. If it is, we require a
// return statement. If it is a code block it could though also be a object definition, so we
// this.isFunction states whether the binding is a simple js statement or a function containing
// a return statement. We decide this on whether it is a code block or not. If it is, we require
// a return statement. If it is a code block it could though also be a object definition, so we
// need to check that as well (it is, if the content is labels).
this.function = tree && tree[0] == "block" && tree[1][0] && tree[1][0][0] !== "label";
this.isFunction = tree && tree[0] == "block" && tree[1][0] && tree[1][0][0] !== "label";
this.src = val;
}

Expand Down
16 changes: 8 additions & 8 deletions src/qtcore.js
@@ -1,4 +1,4 @@
/* @license
/** @license
Copyright (c) 2011 Lauri Paimen <lauri@paimen.info>
Copyright (c) 2013 Anton Kreuzkamp <akreuzkamp@web.de>
Expand Down Expand Up @@ -85,7 +85,7 @@
Normal: "normal",
DemiBold: "600",
Bold: "bold",
Black: "bolder",
Black: "bolder"
},
Easing = {
Linear: 1,
Expand All @@ -110,14 +110,14 @@
evaluatingProperty = undefined,
// All object constructors
constructors = {
int: QMLInteger,
'int': QMLInteger,
real: Number,
double: Number,
'double': Number,
string: String,
bool: Boolean,
'bool': Boolean,
list: QMLList,
color: QMLColor,
enum: Number,
'enum': Number,
url: String,
variant: QMLVariant,
'var': QMLVariant,
Expand Down Expand Up @@ -206,7 +206,7 @@ function descr(msg, obj, vals) {
* Compile binding. Afterwards you may call binding.eval to evaluate.
*/
QMLBinding.prototype.compile = function() {
var bindSrc = this.function
var bindSrc = this.isFunction
? "(function(o, c) { with(c) with(o) " + this.src + "})"
: "(function(o, c) { with(c) with(o) return " + this.src + "})";
this.eval = eval(bindSrc);
Expand Down Expand Up @@ -523,7 +523,7 @@ function applyProperties(metaObject, item, objectScope, componentScope) {
params += item[signalName].parameters[j].name;
}
value.src = "(function(" + params + ") {" + value.src + "})";
value.function = false;
value.isFunction = false;
value.compile();
}
item[signalName].connect(item, value.eval(objectScope, componentScope));
Expand Down

0 comments on commit 4ef79bb

Please sign in to comment.