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

Unified Diff: src/runtime.cc

Issue 13542002: Calling a generator function returns a generator object (Closed) Base URL: git://github.com/v8/v8.git@master
Patch Set: Link generator iterator definitions and uses through local variable Created 7 years, 9 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
Index: src/runtime.cc
diff --git a/src/runtime.cc b/src/runtime.cc
index dcc76181fe488a0aa27a7c734cb7a5be706df303..fde8e9599a0bd080b6e318e78b33036ed9b0d291 100644
--- a/src/runtime.cc
+++ b/src/runtime.cc
@@ -1,4 +1,4 @@
-// Copyright 2012 the V8 project authors. All rights reserved.
+// Copyright 2012, 2013 the V8 project authors. All rights reserved.
Michael Starzinger 2013/04/08 13:14:05 No need to update the copyright header of existing
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
@@ -2385,6 +2385,17 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_SetExpectedNumberOfProperties) {
}
+RUNTIME_FUNCTION(MaybeObject*, Runtime_CreateJSGeneratorIterator) {
+ HandleScope scope(isolate);
+ ASSERT(args.length() == 1);
+ CONVERT_ARG_HANDLE_CHECKED(JSFunction, function, 0);
+ ASSERT(function->shared()->is_generator());
+ Handle<JSGeneratorIterator> generator =
+ isolate->factory()->NewJSGeneratorIterator(function);
Michael Starzinger 2013/04/08 13:14:05 If we call the Heap::AllocateJSGeneratorIterator d
+ return *generator;
+}
+
+
MUST_USE_RESULT static MaybeObject* CharFromCode(Isolate* isolate,
Object* char_code) {
uint32_t code;
« src/parser.cc ('K') | « src/runtime.h ('k') | test/mjsunit/harmony/generators-iteration.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698