Commit 1bace7b7 authored by jan.koester's avatar jan.koester
Browse files

test

parent c0ec30bf
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -11,7 +11,9 @@ var EditorApi = (function() {
            // Strip the leading slash so the URL resolves against the document
            // <base href> (set in <head>) and honours the proxy prefix (/editor).
            xhr.open(method, url.replace(/^\//, ''), true);
            if (data !== undefined) {
                xhr.setRequestHeader('Content-Type', 'application/json');
            }
            xhr.onreadystatechange = function() {
                if (xhr.readyState !== 4) return;
                if (xhr.status === 401) {
@@ -48,7 +50,9 @@ var EditorApi = (function() {
        var xhr = new XMLHttpRequest();
        var promise = new Promise(function(resolve, reject) {
            xhr.open(method, url.replace(/^\//, ''), true);
            if (data !== undefined) {
                xhr.setRequestHeader('Content-Type', 'application/json');
            }
            xhr.onreadystatechange = function() {
                if (xhr.readyState !== 4) return;
                if (xhr.status === 401) {
+1 −2
Original line number Diff line number Diff line
@@ -113,7 +113,6 @@ public:
        v8::HandleScope handleScope(isolate);
        v8::Context::Scope contextScope(context);
        node::async_context asyncContext{0, 0};
        node::CallbackScope callbackScope(setup_->env(), context->Global(), asyncContext);
        v8::TryCatch tryCatch(isolate);

        auto fn = runFunction_.Get(isolate);
@@ -122,7 +121,7 @@ public:
            v8::String::NewFromUtf8(isolate, resPath.c_str()).ToLocalChecked()
        };

        if (fn->Call(context, context->Global(), 2, argv).IsEmpty()) {
        if (node::MakeCallback(isolate, context->Global(), fn, 2, argv, asyncContext).IsEmpty()) {
          if (tryCatch.HasCaught()) {
            v8::String::Utf8Value exceptionUtf8(isolate, tryCatch.Exception());
            const char *msg = *exceptionUtf8 ? *exceptionUtf8 : "unknown JS exception";