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

Unified Diff: third_party/WebKit/Source/core/streams/ReadableStreamTempStub.js

Issue 1404523005: Implement author-constructible ReadableStream using V8 extras (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Minor test tweaks Created 5 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/core/streams/ReadableStream.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/streams/ReadableStreamTempStub.js
diff --git a/third_party/WebKit/Source/core/streams/ReadableStreamTempStub.js b/third_party/WebKit/Source/core/streams/ReadableStreamTempStub.js
new file mode 100644
index 0000000000000000000000000000000000000000..6663056eb3ef78170b6c7155b4eae18251b426d9
--- /dev/null
+++ b/third_party/WebKit/Source/core/streams/ReadableStreamTempStub.js
@@ -0,0 +1,41 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+(function(global, binding, v8) {
+ 'use strict';
+
+ // This file exists to help in the transition between IDL-implemented ReadableStream and V8 extras-implemented
+ // ReadableStream. Before it was introduced, there was an IDL-implemented property of the global object named
+ // "ReadableStream" that had no useful behavior, but might have been depended on by web code for some reason.
+
+ // This file thus emulates that old IDL-implemented property, _when experimental web platform features are disabled_.
+ // When experimental web platform features are _enabled_, the definition of global.ReadableStream in
+ // ReadableStream.js takes priority.
+
+ // Eventually, when the ReadableStream.js implementation is ready to be enabled by default, we can remove this file.
+
+ const TypeError = global.TypeError;
+ const defineProperty = global.Object.defineProperty;
+
+ class ReadableStream {
+ constructor() {
+ throw new TypeError('Illegal constructor');
+ }
+
+ getReader() {
+ throw new TypeError('Illegal invocation');
+ }
+
+ cancel() {
+ throw new TypeError('Illegal invocation');
+ }
+ }
+
+ defineProperty(global, 'ReadableStream', {
+ value: ReadableStream,
+ enumerable: false,
+ configurable: true,
+ writable: true
+ });
+});
« no previous file with comments | « third_party/WebKit/Source/core/streams/ReadableStream.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698