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 1963 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1974 instance, | 1974 instance, |
1975 instance_template, | 1975 instance_template, |
1976 pending_exception); | 1976 pending_exception); |
1977 } else { | 1977 } else { |
1978 *pending_exception = false; | 1978 *pending_exception = false; |
1979 } | 1979 } |
1980 } | 1980 } |
1981 | 1981 |
1982 | 1982 |
1983 Handle<Object> Factory::GlobalConstantFor(Handle<String> name) { | 1983 Handle<Object> Factory::GlobalConstantFor(Handle<String> name) { |
1984 Heap* h = isolate()->heap(); | 1984 if (String::Equals(name, undefined_string())) return undefined_value(); |
1985 if (name->Equals(h->undefined_string())) return undefined_value(); | 1985 if (String::Equals(name, nan_string())) return nan_value(); |
1986 if (name->Equals(h->nan_string())) return nan_value(); | 1986 if (String::Equals(name, infinity_string())) return infinity_value(); |
1987 if (name->Equals(h->infinity_string())) return infinity_value(); | |
1988 return Handle<Object>::null(); | 1987 return Handle<Object>::null(); |
1989 } | 1988 } |
1990 | 1989 |
1991 | 1990 |
1992 Handle<Object> Factory::ToBoolean(bool value) { | 1991 Handle<Object> Factory::ToBoolean(bool value) { |
1993 return value ? true_value() : false_value(); | 1992 return value ? true_value() : false_value(); |
1994 } | 1993 } |
1995 | 1994 |
1996 } } // namespace v8::internal | 1995 } } // namespace v8::internal |
OLD | NEW |