Index: sdk/lib/_internal/compiler/implementation/native_handler.dart |
diff --git a/sdk/lib/_internal/compiler/implementation/native_handler.dart b/sdk/lib/_internal/compiler/implementation/native_handler.dart |
index 74bf5ffb37c2c793954ebe95346d1230151f0e19..038dc439bdeaddab2efba13b169ac7c874aeb819 100644 |
--- a/sdk/lib/_internal/compiler/implementation/native_handler.dart |
+++ b/sdk/lib/_internal/compiler/implementation/native_handler.dart |
@@ -809,47 +809,3 @@ void handleSsaNative(SsaBuilder builder, Expression nativeBody) { |
builder.push(new HForeign.statement(jsCode.dartString, <HInstruction>[])); |
} |
} |
- |
-void generateMethodWithPrototypeCheckForElement(Compiler compiler, |
- StringBuffer buffer, |
- FunctionElement element, |
- String code, |
- String parameters) { |
- String methodName; |
- JavaScriptBackend backend = compiler.backend; |
- Namer namer = backend.namer; |
- if (element.kind == ElementKind.FUNCTION) { |
- methodName = namer.instanceMethodName(element); |
- } else if (element.kind == ElementKind.GETTER) { |
- methodName = namer.getterName(element.getLibrary(), element.name); |
- } else if (element.kind == ElementKind.SETTER) { |
- methodName = namer.setterName(element.getLibrary(), element.name); |
- } else { |
- compiler.internalError('unexpected kind: "${element.kind}"', |
- element: element); |
- } |
- |
- generateMethodWithPrototypeCheck( |
- compiler, buffer, methodName, code, parameters); |
-} |
- |
- |
-// If a method is overridden, we must check if the prototype of |
-// 'this' has the method available. Otherwise, we may end up |
-// calling the method from the super class. If the method is not |
-// available, we make a direct call to Object.prototype.$methodName. |
-// This method will patch the prototype of 'this' to the real method. |
-void generateMethodWithPrototypeCheck(Compiler compiler, |
- StringBuffer buffer, |
- String methodName, |
- String code, |
- String parameters) { |
- buffer.add(" if (Object.getPrototypeOf(this).hasOwnProperty"); |
- buffer.add("('$methodName')) {\n"); |
- buffer.add(" $code"); |
- buffer.add(" } else {\n"); |
- buffer.add(" return Object.prototype.$methodName.call(this"); |
- buffer.add(parameters == '' ? '' : ', $parameters'); |
- buffer.add(");\n"); |
- buffer.add(" }\n"); |
-} |