Skip to content

Commit

Permalink
Fix some closure compiler warnings.
Browse files Browse the repository at this point in the history
PR-URL: #186
Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com>
Reviewed-By: Michael Martin Moro <michael@unetresgrossebite.com>
  • Loading branch information
akreuzkamp authored and Plaristote committed Apr 18, 2016
1 parent 173d6d4 commit b0fdbe2
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/qtcore/font.js
Expand Up @@ -10,5 +10,5 @@ global.Font = {
Normal: "normal",
DemiBold: "600",
Bold: "bold",
Black: "bolder",
Black: "bolder"
}
11 changes: 6 additions & 5 deletions src/qtcore/qml/QMLBinding.js
Expand Up @@ -5,11 +5,12 @@
* @return {Object} Object representing the binding
*/
global.QMLBinding = function(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";
// need to check that as well (it is, if the content is labels).
this.isFunction = tree && tree[0] == "block" && tree[1][0] && tree[1][0][0] !== "label";
this.src = val;
}

Expand All @@ -23,5 +24,5 @@ global.QMLBinding.prototype.toJSON = function() {
* Compile binding. Afterwards you may call binding.eval to evaluate.
*/
QMLBinding.prototype.compile = function() {
this.eval = new Function('__executionObject', '__executionContext', "with(__executionContext) with(__executionObject) " + ( this.function ? "" : "return " ) + this.src);
this.eval = new Function('__executionObject', '__executionContext', "with(__executionContext) with(__executionObject) " + ( this.isFunction ? "" : "return " ) + this.src);
}
10 changes: 5 additions & 5 deletions src/qtcore/qml/qml.js
Expand Up @@ -6,14 +6,14 @@ var GETTER = "__defineGetter__",
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 @@ -290,7 +290,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 b0fdbe2

Please sign in to comment.