From 77808d97572536e2fc11a0a8ba009777cb10de4d Mon Sep 17 00:00:00 2001 From: herr kaste Date: Sat, 23 Jul 2016 14:54:08 +0200 Subject: [PATCH] Rename Path.head() to Path.root(). --- src/lib/path.html | 2 +- src/lib/template/templatizer.html | 4 ++-- src/standard/annotations.html | 2 +- src/standard/effectBuilder.html | 2 +- src/standard/notify-path.html | 4 ++-- test/unit/path.html | 6 +++--- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/lib/path.html b/src/lib/path.html index 25665d966b..f5e0b4d695 100644 --- a/src/lib/path.html +++ b/src/lib/path.html @@ -11,7 +11,7 @@ Polymer.Path = { - head: function(path) { + root: function(path) { var dotIndex = path.indexOf('.'); if (dotIndex === -1) { return path; diff --git a/src/lib/template/templatizer.html b/src/lib/template/templatizer.html index af9dbba02f..0cbdee5dbd 100644 --- a/src/lib/template/templatizer.html +++ b/src/lib/template/templatizer.html @@ -325,7 +325,7 @@ _notifyPathUpImpl: function(path, value) { var dataHost = this.dataHost; - var root = Polymer.Path.head(path); + var root = Polymer.Path.root(path); // Call extension point for Templatizer sub-classes dataHost._forwardInstancePath.call(dataHost, this, path, value); if (root in dataHost._parentProps) { @@ -338,7 +338,7 @@ if (this._forwardParentPath) { if (path.indexOf(this._parentPropPrefix) === 0) { var subPath = path.substring(this._parentPropPrefix.length); - var model = Polymer.Path.head(subPath); + var model = Polymer.Path.root(subPath); if (model in this._parentProps) { this._forwardParentPath(subPath, value); } diff --git a/src/standard/annotations.html b/src/standard/annotations.html index 8e623c2240..2f85666860 100644 --- a/src/standard/annotations.html +++ b/src/standard/annotations.html @@ -150,7 +150,7 @@ if (signature) { p.signature = signature; } else { - p.model = Polymer.Path.head(p.value); + p.model = Polymer.Path.root(p.value); } } } diff --git a/src/standard/effectBuilder.html b/src/standard/effectBuilder.html index bd3952dc4a..87b17b8a03 100644 --- a/src/standard/effectBuilder.html +++ b/src/standard/effectBuilder.html @@ -298,7 +298,7 @@ } // if not literal, look for structured path if (!a.literal) { - a.model = Polymer.Path.head(arg); + a.model = Polymer.Path.root(arg); // detect structured path (has dots) a.structured = Polymer.Path.isDeep(arg); if (a.structured) { diff --git a/src/standard/notify-path.html b/src/standard/notify-path.html index 7c760edd51..2979566fa9 100644 --- a/src/standard/notify-path.html +++ b/src/standard/notify-path.html @@ -272,7 +272,7 @@ _pathEffector: function(path, value) { // get root property - var model = Path.head(path); + var model = Path.root(path); // search property effects of the root property for 'annotation' effects var fx$ = this._propertyEffects && this._propertyEffects[model]; if (fx$) { @@ -369,7 +369,7 @@ }, _notifyPathUp: function(path, value) { - var rootName = Path.head(path); + var rootName = Path.root(path); var dashCaseName = Polymer.CaseMap.camelToDashCase(rootName); var eventName = dashCaseName + this._EVENT_CHANGED; // use a cached event here (_useCache: true) for efficiency diff --git a/test/unit/path.html b/test/unit/path.html index 31dd2e0227..568b01ea0a 100644 --- a/test/unit/path.html +++ b/test/unit/path.html @@ -27,9 +27,9 @@ Path = Polymer.Path; }); - test('head()', function() { - assert.equal(Path.head('foo'), 'foo'); - assert.equal(Path.head('foo.bar'), 'foo'); + test('root()', function() { + assert.equal(Path.root('foo'), 'foo'); + assert.equal(Path.root('foo.bar'), 'foo'); }); test('isDeep()', function() {