OLD | NEW |
---|---|
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...) Loading... | |
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(Error, 'prepareStackTrace', { writable: false }); |
Yang
2017/01/27 08:43:38
if you dont make it non configurable you can still
Michael Achenbach
2017/01/27 08:46:41
Argh! Done...
| |
59 | 59 |
60 // Mock buffer access in float typed arrays because of varying NaN patterns. | 60 // 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 | 61 // Note, for now we just use noop forwarding proxies, because they already |
62 // turn off optimizations. | 62 // turn off optimizations. |
63 function __MockTypedArray(arrayType) { | 63 function __MockTypedArray(arrayType) { |
64 var array_creation_handler = { | 64 var array_creation_handler = { |
65 construct: function(target, args) { | 65 construct: function(target, args) { |
66 return new Proxy(new arrayType(args), {}); | 66 return new Proxy(new arrayType(args), {}); |
67 }, | 67 }, |
68 }; | 68 }; |
(...skipping 19 matching lines...) Loading... | |
88 } | 88 } |
89 this.getMessage = function(){ | 89 this.getMessage = function(){ |
90 index = (index + 1) % 10; | 90 index = (index + 1) % 10; |
91 return workerMessages[index]; | 91 return workerMessages[index]; |
92 } | 92 } |
93 this.postMessage = function(msg){ | 93 this.postMessage = function(msg){ |
94 __PrettyPrint(msg); | 94 __PrettyPrint(msg); |
95 } | 95 } |
96 }; | 96 }; |
97 })(); | 97 })(); |
OLD | NEW |