Skip to content

Commit

Permalink
Adds proto test
Browse files Browse the repository at this point in the history
  • Loading branch information
filipeom committed Jan 23, 2024
1 parent 880672f commit 8a886f9
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test/ecma-sl/symbolic/js/__proto__.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
let obj = {};
console.log(obj.constructor.prototype.__proto__);
let proto = obj.__proto__;
console.log(proto);
// proto.foo = "bar";
// console.log(({}).foo);
5 changes: 5 additions & 0 deletions test/ecma-sl/symbolic/js/dune
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
(cram
(deps
%{bin:ecma-sl}
__proto__.js))

32 changes: 32 additions & 0 deletions test/ecma-sl/symbolic/js/test_proto.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
Test object prototype:
$ dune exec -- ecma-sl symbolic __proto__.js
The file has been saved!
"obj"
"GetValue"
("R", "V", "$loc_7426", "console", false)
"GetValue"
("R", "P", "$loc_7475", "log", false)
"GetValue"
("R", "V", "$loc_7426", "obj", false)
"GetValue"
("R", "P", "$loc_7615", "constructor", false)
"GetValue"
("R", "P", "$loc_86", "prototype", false)
"GetValue"
("R", "P", "$loc_63", "__proto__", false)
warning : ToPrimitive: missing a return statement!
"undefined"
"GetValue"
("R", "V", "$loc_7426", "obj", false)
"GetValue"
("R", "P", "$loc_7615", "__proto__", false)
"proto"
"GetValue"
("R", "V", "$loc_7426", "console", false)
"GetValue"
("R", "P", "$loc_7475", "log", false)
"GetValue"
("R", "V", "$loc_7426", "proto", false)
warning : ToPrimitive: missing a return statement!
"undefined"
path cond :

0 comments on commit 8a886f9

Please sign in to comment.