Browse Source

set doc/win

master
Odilitime 1 year ago
parent
commit
9384083231
1 changed files with 5 additions and 1 deletions
  1. 5
    1
      src/interfaces/elements/SCRIPTElement.cpp

+ 5
- 1
src/interfaces/elements/SCRIPTElement.cpp View File

@@ -3,6 +3,7 @@
#include "../../tools/WebResource.h"
#include "../../tools/Log.h"
#include "../../parsers/scripting/javascript/JSParser.h"
#include "../../parsers/scripting/javascript/BrowserJS.h"
#include "../../app/app.h"
#include <ctime>

@@ -51,7 +52,10 @@ std::unique_ptr<Component> SCRIPTElement::renderer(const ElementRenderRequest &r
}
// parse JS
//std::cout << "SCRIPTElement::renderer - source: " << source << std::endl;
std::shared_ptr<JavaScript> newScript = std::make_shared<JavaScript>();
std::shared_ptr<BrowserJavaScript> newScript = std::make_shared<BrowserJavaScript>();
// set it up as a browser js
newScript->document = request.docComponent;
newScript->window = newScript->document->win.get();
// import current state (scope)
newScript->applyScope(request.docComponent->mainScript);
// parse it

Loading…
Cancel
Save