| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2007, 2008, 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008, 2009 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 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 | 166 |
| 167 return filter.release(); | 167 return filter.release(); |
| 168 } | 168 } |
| 169 | 169 |
| 170 static const int8_t kMaxInt8 = 127; | 170 static const int8_t kMaxInt8 = 127; |
| 171 static const int8_t kMinInt8 = -128; | 171 static const int8_t kMinInt8 = -128; |
| 172 static const uint8_t kMaxUInt8 = 255; | 172 static const uint8_t kMaxUInt8 = 255; |
| 173 const int32_t kMaxInt32 = 0x7fffffff; | 173 const int32_t kMaxInt32 = 0x7fffffff; |
| 174 const int32_t kMinInt32 = -kMaxInt32 - 1; | 174 const int32_t kMinInt32 = -kMaxInt32 - 1; |
| 175 const uint32_t kMaxUInt32 = 0xffffffff; | 175 const uint32_t kMaxUInt32 = 0xffffffff; |
| 176 const int64_t kJSMaxInteger = 0x20000000000000LL - 1; // 2^53 - 1, maximum integ
er exactly representable in ECMAScript. | |
| 177 | 176 |
| 178 static double enforceRange(double x, double minimum, double maximum, bool& ok) | 177 static double enforceRange(double x, double minimum, double maximum, bool& ok) |
| 179 { | 178 { |
| 180 if (std::isnan(x) || std::isinf(x)) { | 179 if (std::isnan(x) || std::isinf(x)) { |
| 181 ok = false; | 180 ok = false; |
| 182 return 0; | 181 return 0; |
| 183 } | 182 } |
| 184 x = trunc(x); | 183 x = trunc(x); |
| 185 if (x < minimum || x > maximum) { | 184 if (x < minimum || x > maximum) { |
| 186 ok = false; | 185 ok = false; |
| (...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 584 return DOMWrapperWorld::isolatedWorld(v8::Context::GetCurrent()); | 583 return DOMWrapperWorld::isolatedWorld(v8::Context::GetCurrent()); |
| 585 } | 584 } |
| 586 | 585 |
| 587 v8::Local<v8::Value> getHiddenValueFromMainWorldWrapper(v8::Isolate* isolate, Sc
riptWrappable* wrappable, v8::Handle<v8::String> key) | 586 v8::Local<v8::Value> getHiddenValueFromMainWorldWrapper(v8::Isolate* isolate, Sc
riptWrappable* wrappable, v8::Handle<v8::String> key) |
| 588 { | 587 { |
| 589 v8::Local<v8::Object> wrapper = wrappable->newLocalWrapper(isolate); | 588 v8::Local<v8::Object> wrapper = wrappable->newLocalWrapper(isolate); |
| 590 return wrapper.IsEmpty() ? v8::Local<v8::Value>() : wrapper->GetHiddenValue(
key); | 589 return wrapper.IsEmpty() ? v8::Local<v8::Value>() : wrapper->GetHiddenValue(
key); |
| 591 } | 590 } |
| 592 | 591 |
| 593 } // namespace WebCore | 592 } // namespace WebCore |
| OLD | NEW |