Commit 0b4a1725 authored by Ronan Abhamon's avatar Ronan Abhamon

fix(ui/scripts/Utils/utils): Qt (5.7.1) crash when a variable in a js file is compared to null

parent 265965da
...@@ -3,7 +3,7 @@ import QtTest 1.1 ...@@ -3,7 +3,7 @@ import QtTest 1.1
import Utils 1.0 import Utils 1.0
// =================================================================== // =============================================================================
Rectangle { Rectangle {
id: root id: root
...@@ -54,7 +54,7 @@ Rectangle { ...@@ -54,7 +54,7 @@ Rectangle {
compare(spy.count, 0, '`pressed` signal was emitted') compare(spy.count, 0, '`pressed` signal was emitted')
} }
// --------------------------------------------------------------- // -------------------------------------------------------------------------
function test_randomClickOutsideMouseArea () { function test_randomClickOutsideMouseArea () {
Utils.times(50, function () { Utils.times(50, function () {
...@@ -80,7 +80,7 @@ Rectangle { ...@@ -80,7 +80,7 @@ Rectangle {
}) })
} }
// --------------------------------------------------------------- // -------------------------------------------------------------------------
function test_clickInsideMouseArea_data () { function test_clickInsideMouseArea_data () {
return [ return [
...@@ -98,7 +98,7 @@ Rectangle { ...@@ -98,7 +98,7 @@ Rectangle {
compare(spy.count, 0, '`pressed` signal was emitted') compare(spy.count, 0, '`pressed` signal was emitted')
} }
// --------------------------------------------------------------- // -------------------------------------------------------------------------
function test_clickOutsideMouseArea_data () { function test_clickOutsideMouseArea_data () {
return [ return [
......
...@@ -34,7 +34,7 @@ function connectOnce (signal, cb) { ...@@ -34,7 +34,7 @@ function connectOnce (signal, cb) {
function encodeTextToQmlRichFormat (text, options) { function encodeTextToQmlRichFormat (text, options) {
var images = '' var images = ''
if (options == null) { if (!options) {
options = {} options = {}
} }
...@@ -218,7 +218,7 @@ function setTimeout (parent, delay, cb) { ...@@ -218,7 +218,7 @@ function setTimeout (parent, delay, cb) {
// =================================================================== // ===================================================================
function _computeOptimizedCb (func, context) { function _computeOptimizedCb (func, context) {
return (context != null) return context
? (function () { ? (function () {
return func.apply(context, arguments) return func.apply(context, arguments)
}) : func }) : func
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment