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

Side by Side Diff: lib/runtime/dart/mirrors.js

Issue 1233553005: Fixes #254 - Better stacktrace support (Closed) Base URL: https://github.com/dart-lang/dev_compiler.git@master
Patch Set: Created 5 years, 5 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
OLDNEW
1 dart_library.library('dart/mirrors', null, /* Imports */[ 1 dart_library.library('dart/mirrors', null, /* Imports */[
2 "dart_runtime/dart", 2 "dart_runtime/dart",
3 'dart/core' 3 'dart/core'
4 ], /* Lazy imports */[ 4 ], /* Lazy imports */[
5 'dart/_js_mirrors' 5 'dart/_js_mirrors'
6 ], function(exports, dart, core, _js_mirrors) { 6 ], function(exports, dart, core, _js_mirrors) {
7 'use strict'; 7 'use strict';
8 let dartx = dart.dartx; 8 let dartx = dart.dartx;
9 class MirrorSystem extends core.Object { 9 class MirrorSystem extends core.Object {
10 findLibrary(libraryName) { 10 findLibrary(libraryName) {
(...skipping 19 matching lines...) Expand all
30 function currentMirrorSystem() { 30 function currentMirrorSystem() {
31 return dart.as(_js_mirrors.currentJsMirrorSystem, MirrorSystem); 31 return dart.as(_js_mirrors.currentJsMirrorSystem, MirrorSystem);
32 } 32 }
33 dart.fn(currentMirrorSystem, MirrorSystem, []); 33 dart.fn(currentMirrorSystem, MirrorSystem, []);
34 function reflect(reflectee) { 34 function reflect(reflectee) {
35 return _js_mirrors.reflect(reflectee); 35 return _js_mirrors.reflect(reflectee);
36 } 36 }
37 dart.fn(reflect, () => dart.definiteFunctionType(InstanceMirror, [core.Object] )); 37 dart.fn(reflect, () => dart.definiteFunctionType(InstanceMirror, [core.Object] ));
38 function reflectClass(key) { 38 function reflectClass(key) {
39 if (!dart.is(key, core.Type) || dart.equals(key, dart.dynamic)) { 39 if (!dart.is(key, core.Type) || dart.equals(key, dart.dynamic)) {
40 throw new core.ArgumentError(`${key} does not denote a class`); 40 dart.throw_(new core.ArgumentError(`${key} does not denote a class`));
41 } 41 }
42 let tm = reflectType(key); 42 let tm = reflectType(key);
43 if (!dart.is(tm, ClassMirror)) { 43 if (!dart.is(tm, ClassMirror)) {
44 throw new core.ArgumentError(`${key} does not denote a class`); 44 dart.throw_(new core.ArgumentError(`${key} does not denote a class`));
45 } 45 }
46 return dart.as(dart.as(tm, ClassMirror).originalDeclaration, ClassMirror); 46 return dart.as(dart.as(tm, ClassMirror).originalDeclaration, ClassMirror);
47 } 47 }
48 dart.fn(reflectClass, () => dart.definiteFunctionType(ClassMirror, [core.Type] )); 48 dart.fn(reflectClass, () => dart.definiteFunctionType(ClassMirror, [core.Type] ));
49 function reflectType(key) { 49 function reflectType(key) {
50 if (dart.equals(key, dart.dynamic)) { 50 if (dart.equals(key, dart.dynamic)) {
51 return currentMirrorSystem().dynamicType; 51 return currentMirrorSystem().dynamicType;
52 } 52 }
53 return _js_mirrors.reflectType(key); 53 return _js_mirrors.reflectType(key);
54 } 54 }
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 exports.FunctionTypeMirror = FunctionTypeMirror; 131 exports.FunctionTypeMirror = FunctionTypeMirror;
132 exports.TypeVariableMirror = TypeVariableMirror; 132 exports.TypeVariableMirror = TypeVariableMirror;
133 exports.TypedefMirror = TypedefMirror; 133 exports.TypedefMirror = TypedefMirror;
134 exports.MethodMirror = MethodMirror; 134 exports.MethodMirror = MethodMirror;
135 exports.VariableMirror = VariableMirror; 135 exports.VariableMirror = VariableMirror;
136 exports.ParameterMirror = ParameterMirror; 136 exports.ParameterMirror = ParameterMirror;
137 exports.SourceLocation = SourceLocation; 137 exports.SourceLocation = SourceLocation;
138 exports.Comment = Comment; 138 exports.Comment = Comment;
139 exports.MirrorsUsed = MirrorsUsed; 139 exports.MirrorsUsed = MirrorsUsed;
140 }); 140 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698