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

Side by Side Diff: tools/foozzie/v8_mock.js

Issue 2654273004: [foozzie] Improve mocking stack traces (Closed)
Patch Set: Review Created 3 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 the V8 project authors. All rights reserved. 1 // Copyright 2016 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 // This is intended for permanent JS behavior changes for mocking out 5 // This is intended for permanent JS behavior changes for mocking out
6 // non-deterministic behavior. For temporary suppressions, please refer to 6 // non-deterministic behavior. For temporary suppressions, please refer to
7 // v8_suppressions.js. 7 // v8_suppressions.js.
8 // This file is loaded before each correctness test cases and won't get 8 // This file is loaded before each correctness test cases and won't get
9 // minimized. 9 // minimized.
10 10
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 }, 48 },
49 } 49 }
50 50
51 Date = new Proxy(Date, handler); 51 Date = new Proxy(Date, handler);
52 })(); 52 })();
53 53
54 // Mock stack traces. 54 // Mock stack traces.
55 Error.prepareStackTrace = function (error, structuredStackTrace) { 55 Error.prepareStackTrace = function (error, structuredStackTrace) {
56 return ""; 56 return "";
57 }; 57 };
58 Object.freeze(Error) 58 Object.defineProperty(
59 Error, 'prepareStackTrace', { configurable: false, writable: false });
59 60
60 // Mock buffer access in float typed arrays because of varying NaN patterns. 61 // Mock buffer access in float typed arrays because of varying NaN patterns.
61 // Note, for now we just use noop forwarding proxies, because they already 62 // Note, for now we just use noop forwarding proxies, because they already
62 // turn off optimizations. 63 // turn off optimizations.
63 function __MockTypedArray(arrayType) { 64 function __MockTypedArray(arrayType) {
64 var array_creation_handler = { 65 var array_creation_handler = {
65 construct: function(target, args) { 66 construct: function(target, args) {
66 return new Proxy(new arrayType(args), {}); 67 return new Proxy(new arrayType(args), {});
67 }, 68 },
68 }; 69 };
(...skipping 19 matching lines...) Expand all
88 } 89 }
89 this.getMessage = function(){ 90 this.getMessage = function(){
90 index = (index + 1) % 10; 91 index = (index + 1) % 10;
91 return workerMessages[index]; 92 return workerMessages[index];
92 } 93 }
93 this.postMessage = function(msg){ 94 this.postMessage = function(msg){
94 __PrettyPrint(msg); 95 __PrettyPrint(msg);
95 } 96 }
96 }; 97 };
97 })(); 98 })();
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698