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

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

Issue 1138793002: Tag closures with their types (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: More comment fixes Created 5 years, 7 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/_js_helper.js ('k') | lib/runtime/dart/_js_primitives.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/runtime/dart/_js_names.js
diff --git a/lib/runtime/dart/_js_names.js b/lib/runtime/dart/_js_names.js
index c5cae962db5500917af70ae23724fe8b8eafbb89..660466986938b484dc51fbe55453dbd0da8cce9a 100644
--- a/lib/runtime/dart/_js_names.js
+++ b/lib/runtime/dart/_js_names.js
@@ -6,9 +6,9 @@ var _interceptors = dart.import(_interceptors);
var _js_helper = dart.lazyImport(_js_helper);
(function(exports, _foreign_helper, _js_embedded_names, core, _interceptors, _js_helper) {
'use strict';
- // Function preserveNames: () → dynamic
function preserveNames() {
}
+ dart.fn(preserveNames);
dart.defineLazyProperties(exports, {
get mangledNames() {
return computeMangledNames(_foreign_helper.JS_EMBEDDED_GLOBAL('=Object', _js_embedded_names.MANGLED_NAMES), false);
@@ -23,7 +23,6 @@ var _js_helper = dart.lazyImport(_js_helper);
return computeReflectiveNames(exports.mangledGlobalNames);
}
});
- // Function computeMangledNames: (dynamic, bool) → Map<String, String>
function computeMangledNames(jsMangledNames, isGlobal) {
preserveNames();
let keys = extractKeys(jsMangledNames);
@@ -42,16 +41,16 @@ var _js_helper = dart.lazyImport(_js_helper);
}
return result;
}
- // Function computeReflectiveNames: (Map<String, String>) → Map
+ dart.fn(computeMangledNames, core.Map$(core.String, core.String), [dart.dynamic, core.bool]);
function computeReflectiveNames(map) {
preserveNames();
let result = dart.map();
- map.forEach((mangledName, reflectiveName) => {
+ map.forEach(dart.fn((mangledName, reflectiveName) => {
result.set(reflectiveName, mangledName);
- });
+ }, dart.dynamic, [core.String, core.String]));
return result;
}
- // Function extractKeys: (dynamic) → List<dynamic>
+ dart.fn(computeReflectiveNames, core.Map$(core.String, core.String), [core.Map$(core.String, core.String)]);
function extractKeys(victim) {
let result = function(victim, hasOwnProperty) {
var result = [];
@@ -63,17 +62,18 @@ var _js_helper = dart.lazyImport(_js_helper);
}(victim, Object.prototype.hasOwnProperty);
return new _interceptors.JSArray.markFixed(result);
}
- // Function unmangleGlobalNameIfPreservedAnyways: (String) → String
+ dart.fn(extractKeys, core.List, [dart.dynamic]);
function unmangleGlobalNameIfPreservedAnyways(name) {
let names = _foreign_helper.JS_EMBEDDED_GLOBAL('=Object', _js_embedded_names.MANGLED_GLOBAL_NAMES);
return dart.as(_js_helper.JsCache.fetch(names, name), core.String);
}
- // Function unmangleAllIdentifiersIfPreservedAnyways: (String) → String
+ dart.fn(unmangleGlobalNameIfPreservedAnyways, core.String, [core.String]);
function unmangleAllIdentifiersIfPreservedAnyways(str) {
return str.replace(/[^<,> ]+/g, function(m) {
return _foreign_helper.JS_EMBEDDED_GLOBAL('', _js_embedded_names.MANGLED_GLOBAL_NAMES)[m] || m;
});
}
+ dart.fn(unmangleAllIdentifiersIfPreservedAnyways, core.String, [core.String]);
// Exports:
exports.preserveNames = preserveNames;
exports.computeMangledNames = computeMangledNames;
« no previous file with comments | « lib/runtime/dart/_js_helper.js ('k') | lib/runtime/dart/_js_primitives.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698