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

Side by Side Diff: src/objects.h

Issue 139653003: Throw a TypeError when calling "next" method of a newly created generator with a value (Closed) Base URL: git://github.com/v8/v8.git@master
Patch Set: Created 6 years, 11 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 unified diff | Download patch
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 7182 matching lines...) Expand 10 before | Expand all | Expand 10 after
7193 7193
7194 // Magic sentinel values for the continuation. 7194 // Magic sentinel values for the continuation.
7195 static const int kGeneratorExecuting = -1; 7195 static const int kGeneratorExecuting = -1;
7196 static const int kGeneratorClosed = 0; 7196 static const int kGeneratorClosed = 0;
7197 7197
7198 // Layout description. 7198 // Layout description.
7199 static const int kFunctionOffset = JSObject::kHeaderSize; 7199 static const int kFunctionOffset = JSObject::kHeaderSize;
7200 static const int kContextOffset = kFunctionOffset + kPointerSize; 7200 static const int kContextOffset = kFunctionOffset + kPointerSize;
7201 static const int kReceiverOffset = kContextOffset + kPointerSize; 7201 static const int kReceiverOffset = kContextOffset + kPointerSize;
7202 static const int kContinuationOffset = kReceiverOffset + kPointerSize; 7202 static const int kContinuationOffset = kReceiverOffset + kPointerSize;
7203 static const int kOperandStackOffset = kContinuationOffset + kPointerSize; 7203 static const int kSuspendedStartOffset = kContinuationOffset + kPointerSize;
7204 static const int kOperandStackOffset = kSuspendedStartOffset + kPointerSize;
7204 static const int kStackHandlerIndexOffset = 7205 static const int kStackHandlerIndexOffset =
7205 kOperandStackOffset + kPointerSize; 7206 kOperandStackOffset + kPointerSize;
7206 static const int kSize = kStackHandlerIndexOffset + kPointerSize; 7207 static const int kSize = kStackHandlerIndexOffset + kPointerSize;
7207 7208
7208 // Resume mode, for use by runtime functions. 7209 // Resume mode, for use by runtime functions.
7209 enum ResumeMode { NEXT, THROW }; 7210 enum ResumeMode { NEXT, THROW };
7210 7211
7211 // Yielding from a generator returns an object with the following inobject 7212 // Yielding from a generator returns an object with the following inobject
7212 // properties. See Context::generator_result_map() for the map. 7213 // properties. See Context::generator_result_map() for the map.
7213 static const int kResultValuePropertyIndex = 0; 7214 static const int kResultValuePropertyIndex = 0;
(...skipping 3441 matching lines...) Expand 10 before | Expand all | Expand 10 after
10655 } else { 10656 } else {
10656 value &= ~(1 << bit_position); 10657 value &= ~(1 << bit_position);
10657 } 10658 }
10658 return value; 10659 return value;
10659 } 10660 }
10660 }; 10661 };
10661 10662
10662 } } // namespace v8::internal 10663 } } // namespace v8::internal
10663 10664
10664 #endif // V8_OBJECTS_H_ 10665 #endif // V8_OBJECTS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698