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

Side by Side Diff: src/factory.cc

Issue 236143002: ES6: Add support for Map.prototype.forEach and Set.prototype.forEach (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Handle-ify and UsedCapacity Created 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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 #include "factory.h" 5 #include "factory.h"
6 6
7 #include "isolate-inl.h" 7 #include "isolate-inl.h"
8 8
9 namespace v8 { 9 namespace v8 {
10 namespace internal { 10 namespace internal {
(...skipping 1978 matching lines...) Expand 10 before | Expand all | Expand 10 after
1989 if (String::Equals(name, nan_string())) return nan_value(); 1989 if (String::Equals(name, nan_string())) return nan_value();
1990 if (String::Equals(name, infinity_string())) return infinity_value(); 1990 if (String::Equals(name, infinity_string())) return infinity_value();
1991 return Handle<Object>::null(); 1991 return Handle<Object>::null();
1992 } 1992 }
1993 1993
1994 1994
1995 Handle<Object> Factory::ToBoolean(bool value) { 1995 Handle<Object> Factory::ToBoolean(bool value) {
1996 return value ? true_value() : false_value(); 1996 return value ? true_value() : false_value();
1997 } 1997 }
1998 1998
1999
2000 Handle<JSObject> Factory::CreateIteratorResultObject(Handle<Object> value,
2001 bool done) {
2002 Handle<Map> map(isolate()->native_context()->iterator_result_map());
2003 Handle<JSObject> result = NewJSObjectFromMap(map, NOT_TENURED, false);
2004 result->InObjectPropertyAtPut(
2005 JSGeneratorObject::kResultValuePropertyIndex, *value);
2006 result->InObjectPropertyAtPut(
2007 JSGeneratorObject::kResultDonePropertyIndex, *ToBoolean(done));
2008 return result;
2009 }
2010
1999 } } // namespace v8::internal 2011 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698