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

Unified Diff: lib/runtime/dart/_rtti.js

Issue 1413683006: Move runtime js files down to lib/runtime/dart (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 5 years, 2 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
« no previous file with comments | « lib/runtime/dart/_operations.js ('k') | lib/runtime/dart/_runtime.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/runtime/dart/_rtti.js
diff --git a/lib/runtime/_rtti.js b/lib/runtime/dart/_rtti.js
similarity index 89%
rename from lib/runtime/_rtti.js
rename to lib/runtime/dart/_rtti.js
index b39c6275634d9a709df7ac05704e0429c64d33ba..badaf8bdd3f449eb6e6c12150a593d5ea431492a 100644
--- a/lib/runtime/_rtti.js
+++ b/lib/runtime/dart/_rtti.js
@@ -6,10 +6,10 @@
* runtime types.
*/
-dart_library.library('dart_runtime/_rtti', null, /* Imports */[
+dart_library.library('dart/_rtti', null, /* Imports */[
], /* Lazy Imports */[
'dart/core',
- 'dart_runtime/_types'
+ 'dart/_types'
], function(exports, core, types) {
'use strict';
@@ -17,8 +17,6 @@ dart_library.library('dart_runtime/_rtti', null, /* Imports */[
const defineProperty = Object.defineProperty;
- const slice = [].slice;
-
/**
* Runtime type information. This module defines the mapping from
* runtime objects to their runtime type information. See the types
@@ -63,22 +61,20 @@ dart_library.library('dart_runtime/_rtti', null, /* Imports */[
* Note that since we are producing a type for a concrete function,
* it is sound to use the definite arrow type.
*/
- function fn(closure/* ...args*/) {
+ function fn(closure, ...args) {
// Closure and a lazy type constructor
- if (arguments.length == 2) {
- defineLazyProperty(closure, _runtimeType, {get : arguments[1]});
+ if (args.length == 1) {
+ defineLazyProperty(closure, _runtimeType, {get : args[0]});
return closure;
}
let t;
- if (arguments.length == 1) {
+ if (args.length == 0) {
// No type arguments, it's all dynamic
- let len = closure.length;
- let args = Array.apply(null, new Array(len)).map(() => types.dynamic);
- t = types.definiteFunctionType(types.dynamic, args);
+ t = types.definiteFunctionType(
+ types.dynamic, Array(closure.length).fill(types.dynamic));
} else {
// We're passed the piecewise components of the function type,
// construct it.
- let args = slice.call(arguments, 1);
t = types.definiteFunctionType.apply(null, args);
}
tag(closure, t);
@@ -117,8 +113,7 @@ dart_library.library('dart_runtime/_rtti', null, /* Imports */[
function getFunctionType(obj) {
// TODO(vsm): Encode this properly on the function for Dart-generated code.
- let args =
- Array.apply(null, new Array(obj.length)).map(() => types.dynamic);
+ let args = Array(obj.length).fill(types.dynamic);
return types.definiteFunctionType(types.bottom, args);
}
@@ -153,7 +148,7 @@ dart_library.library('dart_runtime/_rtti', null, /* Imports */[
}
exports.LazyTagged = LazyTagged;
- function read(value) {
+ function read(value) {
return value[_runtimeType];
}
exports.read = read;
« no previous file with comments | « lib/runtime/dart/_operations.js ('k') | lib/runtime/dart/_runtime.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698