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

Unified Diff: lib/runtime/_types.js

Issue 1252953003: Implement more of dart:mirrors (Closed) Base URL: https://github.com/dart-lang/dev_compiler.git@master
Patch Set: Address comments Created 5 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: lib/runtime/_types.js
diff --git a/lib/runtime/_types.js b/lib/runtime/_types.js
index af5e2d04d24fce2fe1fdf0f7c351b3816aaed66a..482adf4fa1c714f73f63168c77b1fc3052d142ec 100644
--- a/lib/runtime/_types.js
+++ b/lib/runtime/_types.js
@@ -139,6 +139,26 @@ dart_library.library('dart_runtime/_types', null, /* Imports */[
this.args = args;
this.optionals = optionals;
this.named = named;
+
+ // TODO(vsm): This is just parameter metadata for now.
+ this.metadata = [];
+ function process(array, metadata) {
+ var result = [];
+ for (var i = 0; i < array.length; ++i) {
+ var arg = array[i];
+ if (arg instanceof Array) {
+ metadata.push(arg.slice(1));
+ result.push(arg[0]);
+ } else {
+ metadata.push([]);
+ result.push(arg);
+ }
+ }
+ return result;
+ }
+ this.args = process(this.args, this.metadata);
+ this.optionals = process(this.optionals, this.metadata);
+ // TODO(vsm): Add named arguments.
this._canonize();
}
_canonize() {
@@ -202,6 +222,10 @@ dart_library.library('dart_runtime/_types', null, /* Imports */[
get named() {
return this.functionType.named;
}
+
+ get metadata() {
+ return this.functionType.metadata;
+ }
}
function _functionType(definite, returnType, args, extra) {

Powered by Google App Engine
This is Rietveld 408576698