History

Fixed build error after rebase

ksuprynowicz committed 4 years ago

Commit c78ec801 parent 9c6ffc32 files · +9 −189Browse files

Showing the changes to libraries/script-engine/src/qtscript/ArrayBufferClass.cpp (1 of 2 files). Show all

Unified · Split

libraries/script-engine/src/qtscript/ArrayBufferClass.cpp+9−9
@@ -30,11 +30,11 @@ QObject(scriptEngine), · 29 unmodified lines
30QScriptClass(scriptEngine) {30QScriptClass(scriptEngine) {
31 qScriptRegisterMetaType<QByteArray>(engine(), toScriptValue, fromScriptValue);31 qScriptRegisterMetaType<QByteArray>(engine(), toScriptValue, fromScriptValue);
32 QScriptValue global = engine()->globalObject();32 QScriptValue global = engine()->globalObject();
33 33
34 // Save string handles for quick lookup34 // Save string handles for quick lookup
35 _name = engine()->toStringHandle(CLASS_NAME.toLatin1());35 _name = engine()->toStringHandle(CLASS_NAME.toLatin1());
36 _byteLength = engine()->toStringHandle(BYTE_LENGTH_PROPERTY_NAME.toLatin1());36 _byteLength = engine()->toStringHandle(BYTE_LENGTH_PROPERTY_NAME.toLatin1());
37 37
38 // build prototype38 // build prototype
39 _proto = engine()->newQObject(new ArrayBufferPrototype(this),39 _proto = engine()->newQObject(new ArrayBufferPrototype(this),
40 QScriptEngine::QtOwnership,40 QScriptEngine::QtOwnership,
@@ -42,13 +42,13 @@ QScriptClass(scriptEngine) { · 1 unmodified line
42 QScriptEngine::ExcludeSuperClassMethods |42 QScriptEngine::ExcludeSuperClassMethods |
43 QScriptEngine::ExcludeSuperClassProperties);43 QScriptEngine::ExcludeSuperClassProperties);
44 _proto.setPrototype(global.property("Object").property("prototype"));44 _proto.setPrototype(global.property("Object").property("prototype"));
45 45
46 // Register constructor46 // Register constructor
47 _ctor = engine()->newFunction(construct, _proto);47 _ctor = engine()->newFunction(construct, _proto);
48 _ctor.setData(engine()->toScriptValue(this));48 _ctor.setData(engine()->toScriptValue(this));
49 49
50 engine()->globalObject().setProperty(name(), _ctor);50 engine()->globalObject().setProperty(name(), _ctor);
51 51
52 // Registering other array types52 // Registering other array types
53 // The script engine is there parent so it'll delete them with itself53 // The script engine is there parent so it'll delete them with itself
54 new DataViewClass(scriptEngine);54 new DataViewClass(scriptEngine);
@@ -99,16 +99,16 @@ QScriptValue ArrayBufferClass::construct(QScriptContext* context, QScriptEngine* · 44 unmodified lines
99 if (!arg.isValid() || !arg.isNumber()) {99 if (!arg.isValid() || !arg.isNumber()) {
100 return QScriptValue();100 return QScriptValue();
101 }101 }
102 102
103 quint32 size = arg.toInt32();103 quint32 size = arg.toInt32();
104 QScriptValue newObject = cls->newInstance(size);104 QScriptValue newObject = cls->newInstance(size);
105 105
106 if (context->isCalledAsConstructor()) {106 if (context->isCalledAsConstructor()) {
107 // if called with keyword new, replace this object.107 // if called with keyword new, replace this object.
108 context->setThisObject(newObject);108 context->setThisObject(newObject);
109 return engine->undefinedValue();109 return engine->undefinedValue();
110 }110 }
111 111
112 return newObject;112 return newObject;
113}113}
114 114
@@ -120,7 +120,7 @@ QScriptClass::QueryFlags ArrayBufferClass::queryProperty(const QScriptValue& obj · 5 unmodified lines
120 // if the property queried is byteLength, only handle read access120 // if the property queried is byteLength, only handle read access
121 return flags &= HandlesReadAccess;121 return flags &= HandlesReadAccess;
122 }122 }
123 return 0; // No access123 return QScriptClass::QueryFlags(); // No access
124}124}
125 125
126QScriptValue ArrayBufferClass::property(const QScriptValue& object,126QScriptValue ArrayBufferClass::property(const QScriptValue& object,

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