| 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...) Expand 10 before | Expand all | Expand 10 after 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( |
| 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 Loading... |
| 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 })(); |
| OLD | NEW |