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

Unified Diff: src/harmony-typedarray.js

Issue 1120373003: comment typo fix (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 7 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 | test/mjsunit/harmony/typedarrays-every.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/harmony-typedarray.js
diff --git a/src/harmony-typedarray.js b/src/harmony-typedarray.js
index 6a69608ede60e2da5718a147627bb2eaad2fba3c..3326495f0ef667f9c3d13b4dbb96d540ac885b7e 100644
--- a/src/harmony-typedarray.js
+++ b/src/harmony-typedarray.js
@@ -60,6 +60,40 @@ function NAMEForEach(f /* thisArg */) { // length == 1
}
}
+// ES6 draft 05-05-15, section 22.2.3.12
+function NAMEEvery(f /* thisArg */) { // length == 1
+ if (!%IsTypedArray(this)) {
+ throw MakeTypeError('not_typed_array', []);
+ }
+ if (!IS_SPEC_FUNCTION(f)) throw MakeTypeError(kCalledNonCallable, f);
+
+ var length = %_TypedArrayGetLength(this);
+ var receiver;
+
+ if (%_ArgumentsLength() > 1) {
+ receiver = %_Arguments(1);
+ }
+
+ var needs_wrapper = false;
+ if (IS_NULL_OR_UNDEFINED(receiver)) {
+ receiver = %GetDefaultReceiver(f) || receiver;
+ } else {
+ needs_wrapper = SHOULD_CREATE_WRAPPER(f, receiver);
+ }
+
+ var stepping = DEBUG_IS_ACTIVE && %DebugCallbackSupportsStepping(f);
+ for (var i = 0; i < length; i++) {
+ var element = this[i];
+ // Prepare break slots for debugger step in.
+ if (stepping) %DebugPrepareStepInIfStepping(f);
+ var new_receiver = needs_wrapper ? ToObject(receiver) : receiver;
+ if (!%_CallFunction(new_receiver, TO_OBJECT_INLINE(element), i, this, f)) {
+ return false;
+ }
+ }
+ return true;
+}
+
// ES6 draft 08-24-14, section 22.2.2.2
function NAMEOf() { // length == 0
var length = %_ArgumentsLength();
@@ -83,7 +117,8 @@ macro EXTEND_TYPED_ARRAY(ARRAY_ID, NAME, ELEMENT_SIZE)
// Set up non-enumerable functions on the prototype object.
$installFunctions(GlobalNAME.prototype, DONT_ENUM, [
- "forEach", NAMEForEach
+ "forEach", NAMEForEach,
+ "every", NAMEEvery
]);
endmacro
« no previous file with comments | « no previous file | test/mjsunit/harmony/typedarrays-every.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698