Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(674)

Side by Side Diff: sdk/lib/_internal/compiler/implementation/lib/interceptors.dart

Issue 12330135: Make instance methods whose names collide with intercepted methods have the interceptor calling con… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library _interceptors; 5 library _interceptors;
6 6
7 import 'dart:collection'; 7 import 'dart:collection';
8 import 'dart:_collection-dev'; 8 import 'dart:_collection-dev';
9 import 'dart:_js_helper' show allMatchesInStringUnchecked, 9 import 'dart:_js_helper' show allMatchesInStringUnchecked,
10 Null, 10 Null,
(...skipping 13 matching lines...) Expand all
24 stringReplaceAllUnchecked, 24 stringReplaceAllUnchecked,
25 stringReplaceFirstUnchecked, 25 stringReplaceFirstUnchecked,
26 TypeImpl; 26 TypeImpl;
27 import 'dart:_foreign_helper' show JS; 27 import 'dart:_foreign_helper' show JS;
28 28
29 part 'js_array.dart'; 29 part 'js_array.dart';
30 part 'js_number.dart'; 30 part 'js_number.dart';
31 part 'js_string.dart'; 31 part 'js_string.dart';
32 32
33 /** 33 /**
34 * The interceptor class for all non-primitive objects. All its
35 * members are synthethized by the compiler's emitter.
36 */
37 class ObjectInterceptor {
38 const ObjectInterceptor();
39 }
40
41 /**
42 * Get the interceptor for [object]. Called by the compiler when it needs 34 * Get the interceptor for [object]. Called by the compiler when it needs
43 * to emit a call to an intercepted method, that is a method that is 35 * to emit a call to an intercepted method, that is a method that is
44 * defined in an interceptor class. 36 * defined in an interceptor class.
45 */ 37 */
46 getInterceptor(object) { 38 getInterceptor(object) {
47 // This is a magic method: the compiler does specialization of it 39 // This is a magic method: the compiler does specialization of it
48 // depending on the uses of intercepted methods and instantiated 40 // depending on the uses of intercepted methods and instantiated
49 // primitive types. 41 // primitive types.
50 } 42 }
51 43
52 /** 44 /**
45 * If [InvocationMirror.invokeOn] is being used, this variable
46 * contains a JavaScript array with the names of methods that are
47 * intercepted.
48 */
49 var interceptedNames;
50
51 /**
53 * The interceptor class for tear-off static methods. Unlike 52 * The interceptor class for tear-off static methods. Unlike
54 * tear-off instance methods, tear-off static methods are just the JS 53 * tear-off instance methods, tear-off static methods are just the JS
55 * function, and methods inherited from Object must therefore be 54 * function, and methods inherited from Object must therefore be
56 * intercepted. 55 * intercepted.
57 */ 56 */
58 class JSFunction implements Function { 57 class JSFunction implements Function {
59 const JSFunction(); 58 const JSFunction();
60 String toString() => 'Closure'; 59 String toString() => 'Closure';
61 } 60 }
62 61
(...skipping 18 matching lines...) Expand all
81 */ 80 */
82 class JSNull implements Null { 81 class JSNull implements Null {
83 const JSNull(); 82 const JSNull();
84 83
85 // Note: if you change this, also change the function [S]. 84 // Note: if you change this, also change the function [S].
86 String toString() => 'null'; 85 String toString() => 'null';
87 86
88 int get hashCode => 0; 87 int get hashCode => 0;
89 Type get runtimeType => Null; 88 Type get runtimeType => Null;
90 } 89 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698