Skip to content

Commit 77808d9

Browse files
committed
Rename Path.head() to Path.root().
1 parent 478978d commit 77808d9

File tree

6 files changed

+10
-10
lines changed

6 files changed

+10
-10
lines changed

src/lib/path.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
Polymer.Path = {
1313

14-
head: function(path) {
14+
root: function(path) {
1515
var dotIndex = path.indexOf('.');
1616
if (dotIndex === -1) {
1717
return path;

src/lib/template/templatizer.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@
325325

326326
_notifyPathUpImpl: function(path, value) {
327327
var dataHost = this.dataHost;
328-
var root = Polymer.Path.head(path);
328+
var root = Polymer.Path.root(path);
329329
// Call extension point for Templatizer sub-classes
330330
dataHost._forwardInstancePath.call(dataHost, this, path, value);
331331
if (root in dataHost._parentProps) {
@@ -338,7 +338,7 @@
338338
if (this._forwardParentPath) {
339339
if (path.indexOf(this._parentPropPrefix) === 0) {
340340
var subPath = path.substring(this._parentPropPrefix.length);
341-
var model = Polymer.Path.head(subPath);
341+
var model = Polymer.Path.root(subPath);
342342
if (model in this._parentProps) {
343343
this._forwardParentPath(subPath, value);
344344
}

src/standard/annotations.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@
150150
if (signature) {
151151
p.signature = signature;
152152
} else {
153-
p.model = Polymer.Path.head(p.value);
153+
p.model = Polymer.Path.root(p.value);
154154
}
155155
}
156156
}

src/standard/effectBuilder.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@
298298
}
299299
// if not literal, look for structured path
300300
if (!a.literal) {
301-
a.model = Polymer.Path.head(arg);
301+
a.model = Polymer.Path.root(arg);
302302
// detect structured path (has dots)
303303
a.structured = Polymer.Path.isDeep(arg);
304304
if (a.structured) {

src/standard/notify-path.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@
272272

273273
_pathEffector: function(path, value) {
274274
// get root property
275-
var model = Path.head(path);
275+
var model = Path.root(path);
276276
// search property effects of the root property for 'annotation' effects
277277
var fx$ = this._propertyEffects && this._propertyEffects[model];
278278
if (fx$) {
@@ -369,7 +369,7 @@
369369
},
370370

371371
_notifyPathUp: function(path, value) {
372-
var rootName = Path.head(path);
372+
var rootName = Path.root(path);
373373
var dashCaseName = Polymer.CaseMap.camelToDashCase(rootName);
374374
var eventName = dashCaseName + this._EVENT_CHANGED;
375375
// use a cached event here (_useCache: true) for efficiency

test/unit/path.html

+3-3
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@
2727
Path = Polymer.Path;
2828
});
2929

30-
test('head()', function() {
31-
assert.equal(Path.head('foo'), 'foo');
32-
assert.equal(Path.head('foo.bar'), 'foo');
30+
test('root()', function() {
31+
assert.equal(Path.root('foo'), 'foo');
32+
assert.equal(Path.root('foo.bar'), 'foo');
3333
});
3434

3535
test('isDeep()', function() {

0 commit comments

Comments
 (0)