Skip to content

Commit 565b82c

Browse files
Use target.[[Get]](key) directly instead of Reflect.get
Since it denies non-objects like strings according to the spec https://262.ecma-international.org/11.0/#sec-reflect.get Also it throws just `TypeError: Reflect.get called on non-object` while `target.[[Get]]` reports `TypeError: Cannot read properties of null (reading X)` when reading non-object properties
1 parent 28b2c5b commit 565b82c

File tree

1 file changed

+1
-1
lines changed
  • packages/npm-packages/ruby-wasm-wasi/src

1 file changed

+1
-1
lines changed

packages/npm-packages/ruby-wasm-wasi/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ export class RubyVM {
139139
throw new Error("Function not implemented.");
140140
},
141141
reflectGet: function (target, propertyKey) {
142-
return Reflect.get(target, propertyKey);
142+
return target[propertyKey];
143143
},
144144
reflectGetOwnPropertyDescriptor: function (
145145
target,

0 commit comments

Comments
 (0)