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

Unified Diff: src/js/arraybuffer.js

Issue 1929123002: Add checks for detached ArrayBuffers to ArrayBuffer.prototype.slice (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix tests Created 4 years, 8 months 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 | « no previous file | src/messages.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/js/arraybuffer.js
diff --git a/src/js/arraybuffer.js b/src/js/arraybuffer.js
index f0273c71ed757515a096fa554399bca171857d4c..e739960e5be8a21c063a546c960d8114c2f14967 100644
--- a/src/js/arraybuffer.js
+++ b/src/js/arraybuffer.js
@@ -70,7 +70,9 @@ function ArrayBufferSlice(start, end) {
throw MakeTypeError(kIncompatibleMethodReceiver,
'ArrayBuffer.prototype.slice', result);
}
- // TODO(littledan): Check for a detached ArrayBuffer
+ // Checks for detached source/target ArrayBuffers are done inside of
+ // %ArrayBufferSliceImpl; the reordering of checks does not violate
+ // the spec because all exceptions thrown are TypeErrors.
if (result === this) {
throw MakeTypeError(kArrayBufferSpeciesThis);
}
« no previous file with comments | « no previous file | src/messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698