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

Side by Side Diff: src/debug/mirrors.js

Issue 2206183002: Move ErrorToString to runtime (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@port-no-sideeffect-to-string
Patch Set: Rebase Created 4 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 unified diff | Download patch
« no previous file with comments | « BUILD.gn ('k') | src/js/messages.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2006-2012 the V8 project authors. All rights reserved. 1 // Copyright 2006-2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 (function(global, utils) { 5 (function(global, utils) {
6 "use strict"; 6 "use strict";
7 7
8 // ---------------------------------------------------------------------------- 8 // ----------------------------------------------------------------------------
9 // Imports 9 // Imports
10 10
11 var ErrorToString;
12 var GlobalArray = global.Array; 11 var GlobalArray = global.Array;
13 var IsNaN = global.isNaN; 12 var IsNaN = global.isNaN;
14 var JSONStringify = global.JSON.stringify; 13 var JSONStringify = global.JSON.stringify;
15 var MakeError; 14 var MakeError;
16 var MapEntries; 15 var MapEntries;
17 var MapIteratorNext; 16 var MapIteratorNext;
18 var promiseStateSymbol = utils.ImportNow("promise_state_symbol"); 17 var promiseStateSymbol = utils.ImportNow("promise_state_symbol");
19 var promiseResultSymbol = utils.ImportNow("promise_result_symbol"); 18 var promiseResultSymbol = utils.ImportNow("promise_result_symbol");
20 var SetIteratorNext; 19 var SetIteratorNext;
21 var SetValues; 20 var SetValues;
22 21
23 utils.Import(function(from) { 22 utils.Import(function(from) {
24 ErrorToString = from.ErrorToString;
25 MakeError = from.MakeError; 23 MakeError = from.MakeError;
26 MapEntries = from.MapEntries; 24 MapEntries = from.MapEntries;
27 MapIteratorNext = from.MapIteratorNext; 25 MapIteratorNext = from.MapIteratorNext;
28 SetIteratorNext = from.SetIteratorNext; 26 SetIteratorNext = from.SetIteratorNext;
29 SetValues = from.SetValues; 27 SetValues = from.SetValues;
30 }); 28 });
31 29
32 // ---------------------------------------------------------------------------- 30 // ----------------------------------------------------------------------------
33 31
34 // Mirror hierarchy: 32 // Mirror hierarchy:
(...skipping 1213 matching lines...) Expand 10 before | Expand all | Expand 10 after
1248 */ 1246 */
1249 ErrorMirror.prototype.message = function() { 1247 ErrorMirror.prototype.message = function() {
1250 return this.value_.message; 1248 return this.value_.message;
1251 }; 1249 };
1252 1250
1253 1251
1254 ErrorMirror.prototype.toText = function() { 1252 ErrorMirror.prototype.toText = function() {
1255 // Use the same text representation as in messages.js. 1253 // Use the same text representation as in messages.js.
1256 var text; 1254 var text;
1257 try { 1255 try {
1258 text = %_Call(ErrorToString, this.value_); 1256 text = %ErrorToString(this.value_);
1259 } catch (e) { 1257 } catch (e) {
1260 text = '#<Error>'; 1258 text = '#<Error>';
1261 } 1259 }
1262 return text; 1260 return text;
1263 }; 1261 };
1264 1262
1265 1263
1266 /** 1264 /**
1267 * Mirror object for a Promise object. 1265 * Mirror object for a Promise object.
1268 * @param {Object} value The Promise object 1266 * @param {Object} value The Promise object
(...skipping 1783 matching lines...) Expand 10 before | Expand all | Expand 10 after
3052 // Functions needed by the debugger runtime. 3050 // Functions needed by the debugger runtime.
3053 utils.InstallFunctions(utils, DONT_ENUM, [ 3051 utils.InstallFunctions(utils, DONT_ENUM, [
3054 "ClearMirrorCache", ClearMirrorCache 3052 "ClearMirrorCache", ClearMirrorCache
3055 ]); 3053 ]);
3056 3054
3057 // Export to debug.js 3055 // Export to debug.js
3058 utils.Export(function(to) { 3056 utils.Export(function(to) {
3059 to.MirrorType = MirrorType; 3057 to.MirrorType = MirrorType;
3060 }); 3058 });
3061 }) 3059 })
OLDNEW
« no previous file with comments | « BUILD.gn ('k') | src/js/messages.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698