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

Unified Diff: src/debug/mirrors.js

Issue 1404943002: Use import/export for more functions (instead of js builtins object). (Closed) Base URL: https://chromium.googlesource.com/v8/v8.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 | « src/bootstrapper.cc ('k') | src/js/array-iterator.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/debug/mirrors.js
diff --git a/src/debug/mirrors.js b/src/debug/mirrors.js
index 8055d4f9a4444423fe829b9d1107a82499ff2a83..bf27a9ae51a1476ae7e4df2e3455d2538be3fd16 100644
--- a/src/debug/mirrors.js
+++ b/src/debug/mirrors.js
@@ -8,17 +8,27 @@
// ----------------------------------------------------------------------------
// Imports
+var ErrorToString;
var FunctionSourceString;
var GlobalArray = global.Array;
var IsNaN = global.isNaN;
var JSONStringify = global.JSON.stringify;
+var MapEntries;
+var MapIteratorNext;
var MathMin = global.Math.min;
var promiseStatusSymbol = utils.ImportNow("promise_status_symbol");
var promiseValueSymbol = utils.ImportNow("promise_value_symbol");
+var SetIteratorNext;
+var SetValues;
var SymbolToString;
utils.Import(function(from) {
+ ErrorToString = from.ErrorToString;
FunctionSourceString = from.FunctionSourceString;
+ MapEntries = from.MapEntries;
+ MapIteratorNext = from.MapIteratorNext;
+ SetIteratorNext = from.SetIteratorNext;
+ SetValues = from.SetValues;
SymbolToString = from.SymbolToString;
});
@@ -1298,7 +1308,7 @@ ErrorMirror.prototype.toText = function() {
// Use the same text representation as in messages.js.
var text;
try {
- text = %_CallFunction(this.value_, builtins.$errorToString);
+ text = %_CallFunction(this.value_, ErrorToString);
} catch (e) {
text = '#<Error>';
}
@@ -1368,7 +1378,7 @@ MapMirror.prototype.entries = function(opt_limit) {
return result;
}
- var iter = %_CallFunction(this.value_, builtins.$mapEntries);
+ var iter = %_CallFunction(this.value_, MapEntries);
var next;
while ((!opt_limit || result.length < opt_limit) &&
!(next = iter.next()).done) {
@@ -1410,8 +1420,8 @@ SetMirror.prototype.values = function(opt_limit) {
return %GetWeakSetValues(this.value_, opt_limit || 0);
}
- var iter = %_CallFunction(this.value_, builtins.$setValues);
- return IteratorGetValues_(iter, builtins.$setIteratorNext, opt_limit);
+ var iter = %_CallFunction(this.value_, SetValues);
+ return IteratorGetValues_(iter, SetIteratorNext, opt_limit);
};
@@ -1431,11 +1441,11 @@ inherits(IteratorMirror, ObjectMirror);
IteratorMirror.prototype.preview = function(opt_limit) {
if (IS_MAP_ITERATOR(this.value_)) {
return IteratorGetValues_(%MapIteratorClone(this.value_),
- builtins.$mapIteratorNext,
+ MapIteratorNext,
opt_limit);
} else if (IS_SET_ITERATOR(this.value_)) {
return IteratorGetValues_(%SetIteratorClone(this.value_),
- builtins.$setIteratorNext,
+ SetIteratorNext,
opt_limit);
}
};
« no previous file with comments | « src/bootstrapper.cc ('k') | src/js/array-iterator.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698