History

* Inline / duplicate exception checking per CR feedback * Coding standards

humbletim committed 9 years ago

Commit 3ad3fd41 parent 0b73cef3 files · +24 −76Browse files

Showing the changes to libraries/script-engine/src/BaseScriptEngine.h (1 of 3 files). Show all

Unified · Split

libraries/script-engine/src/BaseScriptEngine.h+0−19
@@ -46,25 +46,6 @@ protected: · 45 unmodified lines
46#ifdef DEBUG_JS46#ifdef DEBUG_JS
47 static void _debugDump(const QString& header, const QScriptValue& object, const QString& footer = QString());47 static void _debugDump(const QString& header, const QScriptValue& object, const QString& footer = QString());
48#endif48#endif
49
50 // ExceptionEmitter can be placed above calls that might throw JS exceptions and it'll
51 // automatically signal BaseScriptEngine when falling out of scope (recursion aware).
52 class ExceptionEmitter {
53 public:
54 ExceptionEmitter(BaseScriptEngine* engine, const QString& debugName = QString());
55 // is there a pending exception?
56 bool hasPending();
57 QScriptValue pending();
58 // would it be emitted at scope's end?
59 bool wouldEmit();
60 // consume and return the pending exception
61 QScriptValue consume();
62 ~ExceptionEmitter();
63 protected:
64 BaseScriptEngine* _engine;
65 QString _debugName;
66 QScriptValue _consumedException;
67 };
68};49};
69 50
70// Lambda helps create callable QScriptValues out of std::functions:51// Lambda helps create callable QScriptValues out of std::functions:

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t