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

Side by Side Diff: src/objects.h

Issue 726773002: Throw as per spec when modifying an Array with builtin methods (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 6 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 unified diff | Download patch
« no previous file with comments | « src/builtins.cc ('k') | src/objects.cc » ('j') | src/objects.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef V8_OBJECTS_H_ 5 #ifndef V8_OBJECTS_H_
6 #define V8_OBJECTS_H_ 6 #define V8_OBJECTS_H_
7 7
8 #include <iosfwd> 8 #include <iosfwd>
9 9
10 #include "src/allocation.h" 10 #include "src/allocation.h"
(...skipping 10167 matching lines...) Expand 10 before | Expand all | Expand 10 after
10178 10178
10179 // Overload the length setter to skip write barrier when the length 10179 // Overload the length setter to skip write barrier when the length
10180 // is set to a smi. This matches the set function on FixedArray. 10180 // is set to a smi. This matches the set function on FixedArray.
10181 inline void set_length(Smi* length); 10181 inline void set_length(Smi* length);
10182 10182
10183 static void JSArrayUpdateLengthFromIndex(Handle<JSArray> array, 10183 static void JSArrayUpdateLengthFromIndex(Handle<JSArray> array,
10184 uint32_t index, 10184 uint32_t index,
10185 Handle<Object> value); 10185 Handle<Object> value);
10186 10186
10187 static bool IsReadOnlyLengthDescriptor(Handle<Map> jsarray_map); 10187 static bool IsReadOnlyLengthDescriptor(Handle<Map> jsarray_map);
10188 static bool HasReadOnlyLength(Handle<JSArray> array);
10188 static bool WouldChangeReadOnlyLength(Handle<JSArray> array, uint32_t index); 10189 static bool WouldChangeReadOnlyLength(Handle<JSArray> array, uint32_t index);
10189 static MaybeHandle<Object> ReadOnlyLengthError(Handle<JSArray> array); 10190 static MaybeHandle<Object> ReadOnlyLengthError(Handle<JSArray> array);
10190 10191
10191 // Initialize the array with the given capacity. The function may 10192 // Initialize the array with the given capacity. The function may
10192 // fail due to out-of-memory situations, but only if the requested 10193 // fail due to out-of-memory situations, but only if the requested
10193 // capacity is non-zero. 10194 // capacity is non-zero.
10194 static void Initialize(Handle<JSArray> array, int capacity, int length = 0); 10195 static void Initialize(Handle<JSArray> array, int capacity, int length = 0);
10195 10196
10196 // Initializes the array to a certain length. 10197 // Initializes the array to a certain length.
10197 inline bool AllowsSetElementsLength(); 10198 inline bool AllowsSetElementsLength();
(...skipping 763 matching lines...) Expand 10 before | Expand all | Expand 10 after
10961 } else { 10962 } else {
10962 value &= ~(1 << bit_position); 10963 value &= ~(1 << bit_position);
10963 } 10964 }
10964 return value; 10965 return value;
10965 } 10966 }
10966 }; 10967 };
10967 10968
10968 } } // namespace v8::internal 10969 } } // namespace v8::internal
10969 10970
10970 #endif // V8_OBJECTS_H_ 10971 #endif // V8_OBJECTS_H_
OLDNEW
« no previous file with comments | « src/builtins.cc ('k') | src/objects.cc » ('j') | src/objects.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698