Skip to content

Commit 98a70a0

Browse files
arnopaehlerChALkeR
authored andcommitted
eliminate Undefined and replace references with undefined
PR-URL: qmlweb#113 Reviewed-By: Henrik Rudstrøm <hrudstrom@gmail.com>
1 parent c7eef46 commit 98a70a0

File tree

5 files changed

+12
-13
lines changed

5 files changed

+12
-13
lines changed

src/qtcore/qml/QMLEngine.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -625,7 +625,7 @@ QMLEngine = function (element, options) {
625625
console = {};
626626
console.log = function() {
627627
var args = Array.prototype.slice.call(arguments);
628-
options.debugConsole.apply(Undefined, args);
628+
options.debugConsole.apply(undefined, args);
629629
};
630630
}
631631
}

src/qtcore/qml/elements/QtQuick/Font.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ registerQmlType({
2121
});
2222
this.boldChanged.connect(function(newVal) {
2323
parent.dom.firstChild.style.fontWeight =
24-
parent.font.weight !== Undefined ? parent.font.weight :
24+
parent.font.weight !== undefined ? parent.font.weight :
2525
newVal ? "bold" : "normal";
2626
});
2727
this.capitalizationChanged.connect(function(newVal) {
@@ -37,16 +37,16 @@ registerQmlType({
3737
parent.dom.firstChild.style.fontStyle = newVal ? "italic" : "normal";
3838
});
3939
this.letterSpacingChanged.connect(function(newVal) {
40-
parent.dom.firstChild.style.letterSpacing = newVal !== Undefined ? newVal + "px" : "";
40+
parent.dom.firstChild.style.letterSpacing = newVal !== undefined ? newVal + "px" : "";
4141
});
4242
this.pixelSizeChanged.connect(function(newVal) {
43-
var val = newVal !== Undefined ? newVal + "px "
43+
var val = newVal !== undefined ? newVal + "px "
4444
: (parent.font.pointSize || 10) + "pt";
4545
parent.dom.style.fontSize = val;
4646
parent.dom.firstChild.style.fontSize = val;
4747
});
4848
this.pointSizeChanged.connect(function(newVal) {
49-
var val = parent.font.pixelSize !== Undefined ? parent.font.pixelSize + "px "
49+
var val = parent.font.pixelSize !== undefined ? parent.font.pixelSize + "px "
5050
: (newVal || 10) + "pt";
5151
parent.dom.style.fontSize = val;
5252
parent.dom.firstChild.style.fontSize = val;
@@ -67,11 +67,11 @@ registerQmlType({
6767
});
6868
this.weightChanged.connect(function(newVal) {
6969
parent.dom.firstChild.style.fontWeight =
70-
newVal !== Undefined ? newVal :
70+
newVal !== undefined ? newVal :
7171
parent.font.bold ? "bold" : "normal";
7272
});
7373
this.wordSpacingChanged.connect(function(newVal) {
74-
parent.dom.firstChild.style.wordSpacing = newVal !== Undefined ? newVal + "px" : "";
74+
parent.dom.firstChild.style.wordSpacing = newVal !== undefined ? newVal + "px" : "";
7575
});
7676
}
7777
});

src/qtcore/qml/elements/QtQuick/NumberAnimation.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ registerQmlType({
3131
function startLoop() {
3232
for (var i in this.$actions) {
3333
var action = this.$actions[i];
34-
action.from = action.from !== Undefined ? action.from : action.target[action.property];
34+
action.from = action.from !== undefined ? action.from : action.target[action.property];
3535
}
3636
at = 0;
3737
}

src/qtcore/qml/elements/QtQuick/Text.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ registerQmlType({
2222
|| font.weight == Font.DemiBold
2323
|| font.weight == Font.Black
2424
|| font.bold) ? "bold " : "normal ";
25-
css += font.pixelSize !== Undefined
25+
css += font.pixelSize !== undefined
2626
? font.pixelSize + "px "
2727
: (font.pointSize || 10) + "pt ";
28-
css += this.lineHeight !== Undefined ? this.lineHeight + "px " : " ";
28+
css += this.lineHeight !== undefined ? this.lineHeight + "px " : " ";
2929
css += (font.family || "sans-serif") + " ";
3030
return css;
3131
}
@@ -160,7 +160,7 @@ registerQmlType({
160160
function updateImplicitHeight() {
161161
var height;
162162

163-
if (this.text === Undefined || this.text === "") {
163+
if (this.text === undefined || this.text === "") {
164164
height = 0;
165165
} else {
166166
height = this.dom ? this.dom.firstChild.offsetHeight : 0;
@@ -172,7 +172,7 @@ registerQmlType({
172172
function updateImplicitWidth() {
173173
var width;
174174

175-
if (this.text === Undefined || this.text === "")
175+
if (this.text === undefined || this.text === "")
176176
width = 0;
177177
else
178178
width = this.dom ? this.dom.firstChild.offsetWidth : 0;

src/qtcore/qml/qml.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
var GETTER = "__defineGetter__",
22
SETTER = "__defineSetter__",
3-
Undefined = undefined,
43
// Property that is currently beeing evaluated. Used to get the information
54
// which property called the getter of a certain other property for
65
// evaluation and is thus dependant on it.

0 commit comments

Comments
 (0)