Skip to content

Commit 86708da

Browse files
lauraharkercopybara-github
authored andcommitted
Delete unused CodingConvention::isInlinableByConvention
PiperOrigin-RevId: 512759603
1 parent f31d8ab commit 86708da

File tree

4 files changed

+0
-28
lines changed

4 files changed

+0
-28
lines changed

src/com/google/javascript/jscomp/CodingConvention.java

-5
Original file line numberDiff line numberDiff line change
@@ -239,11 +239,6 @@ public void applySubclassRelationship(
239239
public void applySingletonGetter(
240240
NominalTypeBuilder classType, FunctionType getterType);
241241

242-
/**
243-
* @return Whether the function is inlinable by convention.
244-
*/
245-
public boolean isInlinableFunction(Node n);
246-
247242
/**
248243
* @return the delegate relationship created by the call or null.
249244
*/

src/com/google/javascript/jscomp/CodingConventions.java

-13
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616

1717
package com.google.javascript.jscomp;
1818

19-
import static com.google.common.base.Preconditions.checkState;
20-
2119
import com.google.common.collect.ImmutableList;
2220
import com.google.common.collect.ImmutableSet;
2321
import com.google.errorprone.annotations.Immutable;
@@ -200,11 +198,6 @@ public void applySingletonGetter(
200198
nextConvention.applySingletonGetter(classType, getterType);
201199
}
202200

203-
@Override
204-
public boolean isInlinableFunction(Node n) {
205-
return nextConvention.isInlinableFunction(n);
206-
}
207-
208201
@Override
209202
public DelegateRelationship getDelegateRelationship(Node callNode) {
210203
return nextConvention.getDelegateRelationship(callNode);
@@ -438,12 +431,6 @@ public void applySingletonGetter(
438431
// do nothing.
439432
}
440433

441-
@Override
442-
public boolean isInlinableFunction(Node n) {
443-
checkState(n.isFunction(), n);
444-
return true;
445-
}
446-
447434
@Override
448435
public DelegateRelationship getDelegateRelationship(Node callNode) {
449436
return null;

src/com/google/javascript/jscomp/FunctionInjector.java

-5
Original file line numberDiff line numberDiff line change
@@ -207,17 +207,12 @@ boolean doesFunctionMeetMinimumRequirements(final String fnName, Node fnNode) {
207207
Node block = NodeUtil.getFunctionBody(fnNode);
208208

209209
// Basic restrictions on functions that can be inlined:
210-
// 0) The function is inlinable by convention
211210
// 1) It contains a reference to itself.
212211
// 2) It uses its parameters indirectly using "arguments" (it isn't
213212
// handled yet.
214213
// 3) It references "eval". Inline a function containing eval can have
215214
// large performance implications.
216215

217-
if (!compiler.getCodingConvention().isInlinableFunction(fnNode)) {
218-
return false;
219-
}
220-
221216
final String fnRecursionName = fnNode.getFirstChild().getString();
222217
checkState(fnRecursionName != null);
223218

src/com/google/javascript/jscomp/InlineVariables.java

-5
Original file line numberDiff line numberDiff line change
@@ -972,11 +972,6 @@ private boolean isValidInitialization(Reference initialization) {
972972
checkState(parent.isAssign() && parent.getFirstChild() == initialization.getNode());
973973
}
974974

975-
Node n = initialization.getAssignedValue();
976-
if (n.isFunction()) {
977-
return compiler.getCodingConvention().isInlinableFunction(n);
978-
}
979-
980975
return true;
981976
}
982977

0 commit comments

Comments
 (0)