diff --git a/tests/app/ui/dependency-observable-tests.ts b/tests/app/ui/dependency-observable-tests.ts index 26c9a5067..c891f5de1 100644 --- a/tests/app/ui/dependency-observable-tests.ts +++ b/tests/app/ui/dependency-observable-tests.ts @@ -233,7 +233,7 @@ export function test_PropertyMetadata_Options() { export function test_PropertyEntry_effectiveValue() { var p = new dependencyObservableModule.Property(generatePropertyName(), "testOwner", new dependencyObservableModule.PropertyMetadata(0)); - var entry = new dependencyObservableModule.PropertyEntry(p); + var entry = new dependencyObservableModule.PropertyEntry(); // default value TKUnit.assertEqual(entry.effectiveValue, undefined, "effectiveValue should be undefined."); diff --git a/tests/app/ui/styling/value-source-tests.ts b/tests/app/ui/styling/value-source-tests.ts index 0b72b9ddc..8f4ee85aa 100644 --- a/tests/app/ui/styling/value-source-tests.ts +++ b/tests/app/ui/styling/value-source-tests.ts @@ -2,6 +2,7 @@ import color = require("color"); import button = require("ui/button"); import stack = require("ui/layouts/stack-layout"); import helper = require("../helper"); +import TKUnit = require("../../TKUnit"); export var test_value_Inherited_stronger_than_Default = function () { let page = helper.getCurrentPage(); @@ -26,7 +27,7 @@ export var test_value_Css_stronger_than_Inherited = function () { helper.assertViewColor(btn, "#0000FF"); } -export var test_value_Local_stronger_than_Css = function () { +export function test_value_Local_stronger_than_Css() { let testPage = helper.getCurrentPage(); let testStack = new stack.StackLayout(); testPage.content = testStack; @@ -39,7 +40,7 @@ export var test_value_Local_stronger_than_Css = function () { btn.style.color = new color.Color("#0000FF"); helper.assertViewColor(btn, "#0000FF"); btn.style.color = undefined; - helper.assertViewColor(btn, "#FF0000"); + TKUnit.assertEqual(btn.style.color, undefined, "style.color should be undefined when set locally."); } export var test_value_VisualState_stronger_than_Local = function () { diff --git a/tns-core-modules/ui/core/dependency-observable.d.ts b/tns-core-modules/ui/core/dependency-observable.d.ts index 4eb3d6938..d61745e1f 100644 --- a/tns-core-modules/ui/core/dependency-observable.d.ts +++ b/tns-core-modules/ui/core/dependency-observable.d.ts @@ -162,20 +162,11 @@ declare module "ui/core/dependency-observable" { * Represents an Object that is used to back a value for a Property in a DependencyObservable Object instance. */ export class PropertyEntry { - /** - * Creates a new PropertyEntry instance, associated with the specified Property. - * @param property The Property this entry is attached to. - */ - constructor(property: Property); /** * Resets effective value and all the modifiers available for this entry. */ resetValue(): void; - /** - * Gets the Property instance this entry is associated with. This is a read-only property. - */ - property: Property; /** * Gets the effective value of this entry. * The value is composed depending on the current valueSource value, using the following priority: diff --git a/tns-core-modules/ui/core/dependency-observable.ts b/tns-core-modules/ui/core/dependency-observable.ts index b820cbb07..c454e3440 100644 --- a/tns-core-modules/ui/core/dependency-observable.ts +++ b/tns-core-modules/ui/core/dependency-observable.ts @@ -267,18 +267,6 @@ export class DependencyObservable extends Observable implements definition.Depen this._onPropertyChanged(property, currentValue, newValue); } - - // if (types.isDefined(source)) { - // // resetting particular modifier to undefined will remove it from the effective value composition - // this._resetValueInternal(property, source); - // } else { - // let currentValue = entry.effectiveValue; - // delete this._propertyEntries[property.id]; - // let newValue = this._getDefaultValue(property); - // if (!property.equalityComparer(currentValue, newValue)) { - // this._onPropertyChanged(property, currentValue, newValue); - // } - // } } public _onPropertyChanged(property: Property, oldValue: any, newValue: any) { @@ -385,10 +373,6 @@ export class DependencyObservable extends Observable implements definition.Depen } if (wrapped || !property.equalityComparer(currentValue, realValue)) { - if (realValue === undefined) { - realValue = this.getEffectiveValue(currentValueSource, entry, property); - } - entry.effectiveValue = realValue; this._onPropertyChanged(property, currentValue, realValue); }