[Streams API] Shield streams against user replacing the Promise constructor
[WebKit-https.git] / LayoutTests / streams / streams-promises.html
1 <!DOCTYPE html>
2 <script src='../resources/testharness.js'></script>
3 <script src='../resources/testharnessreport.js'></script>
4 <script>
5 test(function() {
6     Promise = function() { throw new Error("nasty things"); };
7
8     const rs = new ReadableStream(); // Does not throw.
9     const ws = new WritableStream(); // Does not throw.
10 }, 'Streams can be built even if Promise constructor is replaced');
11 </script>