Skip to content

Commit 3f57dd6

Browse files
committed
Revert "store value in prototype as last resort, and use it in property storage"
This reverts commit 84f186e. The reason for that - pureqml does not have to call anything initially. No storage == no change from default value == no onChanged call
1 parent 84f186e commit 3f57dd6

File tree

2 files changed

+1
-9
lines changed

2 files changed

+1
-9
lines changed

core/Object.qml

-3
Original file line numberDiff line numberDiff line change
@@ -175,9 +175,6 @@ EventEmitter {
175175
if (storage !== undefined)
176176
return storage
177177

178-
if (value === undefined)
179-
value = this["__default_" + name]
180-
181178
return this.__properties[name] = new $core.core.PropertyStorage(value)
182179
}
183180

core/core.js

+1-6
Original file line numberDiff line numberDiff line change
@@ -561,12 +561,8 @@ PropertyStoragePrototype.callOnChangedWithCurrentValue = function(object, name,
561561
return
562562

563563
var value = this.value
564-
if (value === undefined)
565-
{
566-
var defaultValue = object["__default_" + name]
567-
callback(defaultValue)
564+
if (value === undefined) //default - nothing changed since storage was created.
568565
return
569-
}
570566

571567
var invoker = $core.safeCall(object, [value], function(ex) { log("on " + name + " changed callback failed: ", ex, ex.stack) })
572568
invoker(callback)
@@ -646,7 +642,6 @@ exports.addProperty = function(proto, type, name, defaultValue) {
646642
} else {
647643
defaultValue = getDefaultValueForType(type)
648644
}
649-
proto["__default_" + name] = defaultValue
650645

651646
var createStorage = function(newValue) {
652647
var properties = this.__properties

0 commit comments

Comments
 (0)