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

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: static-ify 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 Handle<JSObject> Factory::CreateIteratorResultObject(Handle<Object> value,
2000 bool done) {
2001 Handle<Map> map(isolate()->native_context()->iterator_result_map());
2002 Handle<JSObject> result = NewJSObjectFromMap(map, NOT_TENURED, false);
2003 JSObject::SetProperty(result, value_string(), value, NONE, SLOPPY).Assert();
adamk 2014/04/14 21:33:01 I think you can skip all the JSObject machinery he
arv (Not doing code reviews) 2014/04/14 21:41:56 Done.
2004 JSObject::SetProperty(
2005 result, done_string(), ToBoolean(done), NONE, SLOPPY).Assert();
2006 return result;
2007 }
2008
1999 } } // namespace v8::internal 2009 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/factory.h ('k') | src/ia32/full-codegen-ia32.cc » ('j') | src/objects.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698