| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009, 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2009, 2011 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 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 exceptionState.throwDOMException(InvalidAccessError, "No script context
is available in which to execute the script."); | 88 exceptionState.throwDOMException(InvalidAccessError, "No script context
is available in which to execute the script."); |
| 89 return; | 89 return; |
| 90 } | 90 } |
| 91 | 91 |
| 92 v8::Handle<v8::Value> function = info[0]; | 92 v8::Handle<v8::Value> function = info[0]; |
| 93 String functionString; | 93 String functionString; |
| 94 if (!function->IsFunction()) { | 94 if (!function->IsFunction()) { |
| 95 if (function->IsString()) { | 95 if (function->IsString()) { |
| 96 functionString = toWebCoreString(function.As<v8::String>()); | 96 functionString = toWebCoreString(function.As<v8::String>()); |
| 97 } else { | 97 } else { |
| 98 v8::Handle<v8::Value> v8String = function->ToString(); | 98 v8::Handle<v8::String> v8String = function->ToString(); |
| 99 | 99 |
| 100 // Bail out if string conversion failed. | 100 // Bail out if string conversion failed. |
| 101 if (v8String.IsEmpty()) | 101 if (v8String.IsEmpty()) |
| 102 return; | 102 return; |
| 103 | 103 |
| 104 functionString = toWebCoreString(v8String); | 104 functionString = toWebCoreString(v8String); |
| 105 } | 105 } |
| 106 | 106 |
| 107 // Don't allow setting timeouts to run empty functions! | 107 // Don't allow setting timeouts to run empty functions! |
| 108 // (Bug 1009597) | 108 // (Bug 1009597) |
| (...skipping 457 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 566 v8::Handle<v8::Context> context = frame->script().currentWorldContext(); | 566 v8::Handle<v8::Context> context = frame->script().currentWorldContext(); |
| 567 if (context.IsEmpty()) | 567 if (context.IsEmpty()) |
| 568 return v8Undefined(); | 568 return v8Undefined(); |
| 569 | 569 |
| 570 v8::Handle<v8::Object> global = context->Global(); | 570 v8::Handle<v8::Object> global = context->Global(); |
| 571 ASSERT(!global.IsEmpty()); | 571 ASSERT(!global.IsEmpty()); |
| 572 return global; | 572 return global; |
| 573 } | 573 } |
| 574 | 574 |
| 575 } // namespace WebCore | 575 } // namespace WebCore |
| OLD | NEW |