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(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 |
OLD | NEW |