Remove unnecessary type-casting in FastPath (#7506)

This commit is contained in:
fisker Cheung authored and GitHub committed 2020-02-14 13:21:19 +03:00
1 parent 03655b48e9
commit b26d66feb3
1 file changed
+6 -6
+6 -6
View File
@@ -41,12 +41,12 @@ class FastPath {
return getLast(this.stack);
}
getNode(count) {
return getNodeHelper(this, ~~count);
getNode(count = 0) {
return getNodeHelper(this, count);
}
getParentNode(count) {
return getNodeHelper(this, ~~count + 1);
getParentNode(count = 0) {
return getNodeHelper(this, count + 1);
}
// Temporarily push properties named by string arguments given after the
@@ -68,8 +68,8 @@ class FastPath {
return result;
}
callParent(callback, count) {
const stackIndex = getNodeStackIndexHelper(this.stack, ~~count + 1);
callParent(callback, count = 0) {
const stackIndex = getNodeStackIndexHelper(this.stack, count + 1);
const parentValues = this.stack.splice(stackIndex + 1);
const result = callback(this);
this.stack.push(...parentValues);