Showing the changes to libraries/script-engine/src/ScriptValueUtils.cpp (1 of 17 files). Show all
Unified · Split
| @@ -183,7 +183,7 @@ ScriptValue vec3ToScriptValue(ScriptEngine* engine, const glm::vec3& vec3) { · 182 unmodified lines | ||
| 183 | 183 | auto prototype = engine->globalObject().property("__hifi_vec3__"); |
| 184 | 184 | if (!prototype.hasProperty("defined") || !prototype.property("defined").toBool()) { |
| 185 | 185 | prototype = engine->evaluate( |
| 186 | − "__hifi_vec3__ = Object.defineProperties({}, { " | |
| 186 | + "globalThis.__hifi_vec3__ = Object.defineProperties({}, { " | |
| 187 | 187 | "defined: { value: true }," |
| 188 | 188 | "0: { set: function(nv) { return this.x = nv; }, get: function() { return this.x; } }," |
| 189 | 189 | "1: { set: function(nv) { return this.y = nv; }, get: function() { return this.y; } }," |
| @@ -209,7 +209,7 @@ ScriptValue vec3ColorToScriptValue(ScriptEngine* engine, const glm::vec3& vec3) · 19 unmodified lines | ||
| 209 | 209 | auto prototype = engine->globalObject().property("__hifi_vec3_color__"); |
| 210 | 210 | if (!prototype.property("defined").toBool()) { |
| 211 | 211 | prototype = engine->evaluate( |
| 212 | − "__hifi_vec3_color__ = Object.defineProperties({}, { " | |
| 212 | + "globalThis.__hifi_vec3_color__ = Object.defineProperties({}, { " | |
| 213 | 213 | "defined: { value: true }," |
| 214 | 214 | "0: { set: function(nv) { return this.red = nv; }, get: function() { return this.red; } }," |
| 215 | 215 | "1: { set: function(nv) { return this.green = nv; }, get: function() { return this.green; } }," |