OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2014 Google Inc. All rights reserved. | 2 * Copyright (C) 2014 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 | 93 |
94 bool operator==(const V8ScriptValue& value) const | 94 bool operator==(const V8ScriptValue& value) const |
95 { | 95 { |
96 if (hasNoValue()) | 96 if (hasNoValue()) |
97 return value.hasNoValue(); | 97 return value.hasNoValue(); |
98 if (value.hasNoValue()) | 98 if (value.hasNoValue()) |
99 return false; | 99 return false; |
100 return *m_value == *value.m_value; | 100 return *m_value == *value.m_value; |
101 } | 101 } |
102 | 102 |
103 bool isEqual(ScriptState*, const V8ScriptValue& value) const | |
104 { | |
105 return operator==(value); | |
106 } | |
107 | |
108 // Note: This creates a new local Handle; not to be used in cases where is | 103 // Note: This creates a new local Handle; not to be used in cases where is |
109 // is an efficiency problem. | 104 // is an efficiency problem. |
110 bool isFunction() const | 105 bool isFunction() const |
111 { | 106 { |
112 ASSERT(!hasNoValue()); | 107 ASSERT(!hasNoValue()); |
113 v8::Handle<v8::Value> value = v8Value(); | 108 v8::Handle<v8::Value> value = v8Value(); |
114 return !value.IsEmpty() && value->IsFunction(); | 109 return !value.IsEmpty() && value->IsFunction(); |
115 } | 110 } |
116 | 111 |
117 bool operator!=(const V8ScriptValue& value) const | 112 bool operator!=(const V8ScriptValue& value) const |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 : m_isolate(isolate) | 174 : m_isolate(isolate) |
180 , m_value(value.IsEmpty() ? nullptr : SharedPersistent<v8::Value>::creat
e(value, isolate)) | 175 , m_value(value.IsEmpty() ? nullptr : SharedPersistent<v8::Value>::creat
e(value, isolate)) |
181 { | 176 { |
182 } | 177 } |
183 | 178 |
184 }; | 179 }; |
185 | 180 |
186 } // namespace WebCore | 181 } // namespace WebCore |
187 | 182 |
188 #endif // V8ScriptValue_h | 183 #endif // V8ScriptValue_h |
OLD | NEW |