OLD | NEW |
---|---|
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 Loading... | |
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( | |
2004 result, | |
2005 InternalizeOneByteString(STATIC_ASCII_VECTOR("value")), | |
adamk
2014/04/14 19:15:42
"value" and "done" are already available in the he
arv (Not doing code reviews)
2014/04/14 19:51:49
Done.
| |
2006 value, | |
2007 NONE, | |
2008 SLOPPY).Assert(); | |
2009 JSObject::SetProperty( | |
2010 result, | |
2011 InternalizeOneByteString(STATIC_ASCII_VECTOR("done")), | |
2012 ToBoolean(done), | |
2013 NONE, | |
2014 SLOPPY).Assert(); | |
2015 return result; | |
2016 } | |
2017 | |
1999 } } // namespace v8::internal | 2018 } } // namespace v8::internal |
OLD | NEW |