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

Unified Diff: test/codegen/expect/_js_names/_js_names.js

Issue 968273002: Fixing layout in js output (use full paths rather than just the library name) (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 5 years, 10 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: test/codegen/expect/_js_names/_js_names.js
diff --git a/test/codegen/expect/_js_names/_js_names.js b/test/codegen/expect/_js_names/_js_names.js
deleted file mode 100644
index 804cdd9630cc9fddf93c641b73892c9d57aadff7..0000000000000000000000000000000000000000
--- a/test/codegen/expect/_js_names/_js_names.js
+++ /dev/null
@@ -1,79 +0,0 @@
-var _js_names;
-(function(_js_names) {
- 'use strict';
- // Function preserveNames: () → dynamic
- function preserveNames() {
- }
- dart.defineLazyProperties(_js_names, {
- get mangledNames() {
- return computeMangledNames(_foreign_helper.JS_EMBEDDED_GLOBAL('=Object', dart.as(_js_embedded_names.MANGLED_NAMES, core.String)), false);
- },
- get reflectiveNames() {
- return computeReflectiveNames(_js_names.mangledNames);
- },
- get mangledGlobalNames() {
- return computeMangledNames(_foreign_helper.JS_EMBEDDED_GLOBAL('=Object', dart.as(_js_embedded_names.MANGLED_GLOBAL_NAMES, core.String)), true);
- },
- get reflectiveGlobalNames() {
- return computeReflectiveNames(_js_names.mangledGlobalNames);
- }
- });
- // Function computeMangledNames: (dynamic, bool) → Map<String, String>
- function computeMangledNames(jsMangledNames, isGlobal) {
- preserveNames();
- let keys = extractKeys(jsMangledNames);
- let result = dart.map();
- let getterPrefix = _foreign_helper.JS_GET_NAME('GETTER_PREFIX');
- let getterPrefixLength = getterPrefix.length;
- let setterPrefix = _foreign_helper.JS_GET_NAME('SETTER_PREFIX');
- for (let key of keys) {
- let value = jsMangledNames[key];
- result.set(key, value);
- if (!dart.notNull(isGlobal)) {
- if (key.startsWith(getterPrefix)) {
- result.set(`${setterPrefix}${key.substring(getterPrefixLength)}`, `${value}=`);
- }
- }
- }
- return result;
- }
- // Function computeReflectiveNames: (Map<String, String>) → Map
- function computeReflectiveNames(map) {
- preserveNames();
- let result = dart.map();
- map.forEach((mangledName, reflectiveName) => {
- result.set(reflectiveName, mangledName);
- });
- return result;
- }
- // Function extractKeys: (dynamic) → List<dynamic>
- function extractKeys(victim) {
- let result = function(victim, hasOwnProperty) {
- var result = [];
- for (var key in victim) {
- if (hasOwnProperty.call(victim, key))
- result.push(key);
- }
- return result;
- }(victim, Object.prototype.hasOwnProperty);
- return new _interceptors.JSArray.markFixed(result);
- }
- // Function unmangleGlobalNameIfPreservedAnyways: (String) → String
- function unmangleGlobalNameIfPreservedAnyways(name) {
- let names = _foreign_helper.JS_EMBEDDED_GLOBAL('=Object', dart.as(_js_embedded_names.MANGLED_GLOBAL_NAMES, core.String));
- return dart.as(_js_helper.JsCache.fetch(names, name), core.String);
- }
- // Function unmangleAllIdentifiersIfPreservedAnyways: (String) → String
- function unmangleAllIdentifiersIfPreservedAnyways(str) {
- return str.replace(/[^<,> ]+/g, function(m) {
- return _foreign_helper.JS_EMBEDDED_GLOBAL('', dart.as(_js_embedded_names.MANGLED_GLOBAL_NAMES, core.String))[m] || m;
- });
- }
- // Exports:
- _js_names.preserveNames = preserveNames;
- _js_names.computeMangledNames = computeMangledNames;
- _js_names.computeReflectiveNames = computeReflectiveNames;
- _js_names.extractKeys = extractKeys;
- _js_names.unmangleGlobalNameIfPreservedAnyways = unmangleGlobalNameIfPreservedAnyways;
- _js_names.unmangleAllIdentifiersIfPreservedAnyways = unmangleAllIdentifiersIfPreservedAnyways;
-})(_js_names || (_js_names = {}));

Powered by Google App Engine
This is Rietveld 408576698