OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 16 matching lines...) Expand all Loading... |
27 | 27 |
28 // Flags: --allow-natives-syntax | 28 // Flags: --allow-natives-syntax |
29 | 29 |
30 // Make sure we don't rely on functions patchable by monkeys. | 30 // Make sure we don't rely on functions patchable by monkeys. |
31 var call = Function.prototype.call.call.bind(Function.prototype.call) | 31 var call = Function.prototype.call.call.bind(Function.prototype.call) |
32 var getOwnPropertyNames = Object.getOwnPropertyNames; | 32 var getOwnPropertyNames = Object.getOwnPropertyNames; |
33 var defineProperty = Object.defineProperty; | 33 var defineProperty = Object.defineProperty; |
34 var numberPrototype = Number.prototype; | 34 var numberPrototype = Number.prototype; |
35 var symbolIterator = Symbol.iterator; | 35 var symbolIterator = Symbol.iterator; |
36 | 36 |
| 37 function assertUnreachable() { |
| 38 %AbortJS("Failure: unreachable"); |
| 39 } |
37 | 40 |
38 (function() { | 41 (function() { |
39 // Test before clearing global (fails otherwise) | 42 // Test before clearing global (fails otherwise) |
40 assertEquals("[object Promise]", | 43 assertEquals("[object Promise]", |
41 Object.prototype.toString.call(new Promise(function() {}))); | 44 Object.prototype.toString.call(new Promise(function() {}))); |
42 })(); | 45 })(); |
43 | 46 |
44 | 47 |
45 function clear(o) { | 48 function clear(o) { |
46 if (o === null || (typeof o !== 'object' && typeof o !== 'function')) return | 49 if (o === null || (typeof o !== 'object' && typeof o !== 'function')) return |
(...skipping 957 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1004 var p = Promise.resolve(); | 1007 var p = Promise.resolve(); |
1005 var callCount = 0; | 1008 var callCount = 0; |
1006 defineProperty(p, "constructor", { | 1009 defineProperty(p, "constructor", { |
1007 get: function() { ++callCount; return Promise; } | 1010 get: function() { ++callCount; return Promise; } |
1008 }); | 1011 }); |
1009 p.then(); | 1012 p.then(); |
1010 assertEquals(1, callCount); | 1013 assertEquals(1, callCount); |
1011 })(); | 1014 })(); |
1012 | 1015 |
1013 assertAsyncDone() | 1016 assertAsyncDone() |
OLD | NEW |