| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007, 2008, 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 if (function.IsEmpty()) | 76 if (function.IsEmpty()) |
| 77 return; | 77 return; |
| 78 // If the open property is not a function throw a type error. | 78 // If the open property is not a function throw a type error. |
| 79 if (!function->IsFunction()) { | 79 if (!function->IsFunction()) { |
| 80 V8ThrowException::throwTypeError(info.GetIsolate(), | 80 V8ThrowException::throwTypeError(info.GetIsolate(), |
| 81 "open is not a function"); | 81 "open is not a function"); |
| 82 return; | 82 return; |
| 83 } | 83 } |
| 84 // Wrap up the arguments and call the function. | 84 // Wrap up the arguments and call the function. |
| 85 std::unique_ptr<v8::Local<v8::Value>[]> params = | 85 std::unique_ptr<v8::Local<v8::Value>[]> params = |
| 86 wrapArrayUnique(new v8::Local<v8::Value>[ info.Length() ]); | 86 wrapArrayUnique(new v8::Local<v8::Value>[info.Length()]); |
| 87 for (int i = 0; i < info.Length(); i++) | 87 for (int i = 0; i < info.Length(); i++) |
| 88 params[i] = info[i]; | 88 params[i] = info[i]; |
| 89 | 89 |
| 90 v8SetReturnValue( | 90 v8SetReturnValue( |
| 91 info, V8ScriptRunner::callFunction( | 91 info, |
| 92 v8::Local<v8::Function>::Cast(function), frame->document(), | 92 V8ScriptRunner::callFunction(v8::Local<v8::Function>::Cast(function), |
| 93 global, info.Length(), params.get(), info.GetIsolate())); | 93 frame->document(), global, info.Length(), |
| 94 params.get(), info.GetIsolate())); |
| 94 return; | 95 return; |
| 95 } | 96 } |
| 96 | 97 |
| 97 ExceptionState exceptionState( | 98 ExceptionState exceptionState( |
| 98 info.GetIsolate(), ExceptionState::ExecutionContext, "Document", "open"); | 99 info.GetIsolate(), ExceptionState::ExecutionContext, "Document", "open"); |
| 99 document->open(enteredDOMWindow(info.GetIsolate())->document(), | 100 document->open(enteredDOMWindow(info.GetIsolate())->document(), |
| 100 exceptionState); | 101 exceptionState); |
| 101 | 102 |
| 102 v8SetReturnValue(info, info.Holder()); | 103 v8SetReturnValue(info, info.Holder()); |
| 103 } | 104 } |
| (...skipping 19 matching lines...) Expand all Loading... |
| 123 UseCounter::DocumentCreateTouchTargetWrongType); | 124 UseCounter::DocumentCreateTouchTargetWrongType); |
| 124 } | 125 } |
| 125 | 126 |
| 126 if (info.Length() < 7) { | 127 if (info.Length() < 7) { |
| 127 UseCounter::count(currentExecutionContext(info.GetIsolate()), | 128 UseCounter::count(currentExecutionContext(info.GetIsolate()), |
| 128 UseCounter::DocumentCreateTouchLessThanSevenArguments); | 129 UseCounter::DocumentCreateTouchLessThanSevenArguments); |
| 129 } | 130 } |
| 130 } | 131 } |
| 131 | 132 |
| 132 } // namespace blink | 133 } // namespace blink |
| OLD | NEW |