| Index: sky/engine/bindings2/scripts/templates/methods_cpp.template
|
| diff --git a/sky/engine/bindings2/scripts/templates/methods_cpp.template b/sky/engine/bindings2/scripts/templates/methods_cpp.template
|
| index 4946eb906ba16bc9f9bc88a09ff82f609af073f4..aac59cd3b93159251450096d09fee9866e659823 100644
|
| --- a/sky/engine/bindings2/scripts/templates/methods_cpp.template
|
| +++ b/sky/engine/bindings2/scripts/templates/methods_cpp.template
|
| @@ -94,14 +94,14 @@ static void {{static_method_name(method.name, overload_index)}}(Dart_NativeArgum
|
| {% if method.is_call_with_script_state %}
|
| ScriptState* state = DartUtilities::currentScriptState();
|
| if (!state) {
|
| - exception = Dart_NewStringFromCString("Failed to retrieve a script state");
|
| + exception = ToDart("Failed to retrieve a script state");
|
| goto fail;
|
| }
|
| {% endif %}
|
| {% if method.is_call_with_execution_context %}
|
| ExecutionContext* context = DOMDartState::CurrentDocument();
|
| if (!context) {
|
| - exception = Dart_NewStringFromCString("Failed to retrieve a context");
|
| + exception = ToDart("Failed to retrieve a context");
|
| goto fail;
|
| }
|
| {% endif %}
|
| @@ -318,14 +318,14 @@ static void {{static_method_name(constructor.name, overload_index)}}(Dart_Native
|
| {% if is_constructor_call_with_execution_context %}
|
| ExecutionContext* context = DOMDartState::CurrentDocument();
|
| if (!context) {
|
| - exception = Dart_NewStringFromCString("Failed to retrieve a context");
|
| + exception = ToDart("Failed to retrieve a context");
|
| goto fail;
|
| }
|
| {% endif %}
|
| {% if is_constructor_call_with_document or (constructor == named_constructor) %}
|
| LocalDOMWindow* domWindow = DOMDartState::CurrentWindow();
|
| if (!domWindow) {
|
| - exception = Dart_NewStringFromCString("Failed to fetch domWindow");
|
| + exception = ToDart("Failed to fetch domWindow");
|
| goto fail;
|
| }
|
| Document& document = *domWindow->document();
|
|
|