Comments (1)
Not a bug. ctor vs object.
Try this:
$ bin/potion -Dt -e'Object()
Object
Object()
Object()!=Object'
-- run-time --
[ 1] self 1 ; Lobby
[ 2] loadk 0 0 ; Object
[ 3] msg 0 1 ; Object
[ 4] call 0 1 ; <Object 7ffca42d26d8>
[ 5] self 1 ; Lobby
[ 6] loadk 0 0 ; Object
[ 7] bind 0 1 ; function Object()
[ 8] loadpn 2 0 ; nil
[ 9] call 0 2 ; Object
[10] self 1 ; Lobby
[11] loadk 0 0 ; Object
[12] msg 0 1 ; Object
[13] call 0 1 ; <Object 7ffca42d2860>
[14] self 1 ; Lobby
[15] loadk 0 0 ; Object
[16] msg 0 1 ; Object
[17] call 0 1 ; <Object 7ffca42d2948>
[18] self 2 ; Lobby
[19] loadk 1 0 ; Object
[20] bind 1 2 ; function Object()
[21] loadpn 3 0 ; nil
[22] call 1 3 ; Object
[23] neq 0 1 ; <Object 7ffca42d2948>!=Object ; true
[24] return 0 ; true
With -Dvt even more.
Object() creates a new Object instance, it is the ctor ("constructor").
That's the first VTABLE path in OP_CALL in the vm, calling potion_object_new(), and then falling thru to the 2nd closure path.
Object returns the current Object.
That's running only the second CLOSURE path in OP_CALL in the vm, just calling the
closure without creating a new object.
from potion.
Related Issues (20)
- Problem with potion installation HOT 2
- Make fails HOT 4
- Migrate LGTM.com installation from OAuth to GitHub App
- Make fails HOT 1
- 1 out of 282 tests failed HOT 3
- Unable to build with the new -D_FORTIFY_SOURCE=2 HOT 3
- When building under vagrant/precise32, build succeeds but some tests, examples fail HOT 3
- test/tutorial/07_subclass.pn is failing on master HOT 4
- wrong x-1 parsing precedence, whitespace
- numeric compare in wrong integer context HOT 2
- change numcmp for eq and neq
- call on nil segfaults HOT 7
- call on nil methods silently fail HOT 3
- Installation issue HOT 4
- callset on nil segfaults HOT 2
- fatal: Not a git repository (or any of the parent directories): .git HOT 1
- compile: unknown builtin '__builtin_saddl_overflow' HOT 4
- More segmentation faults HOT 7
- Comparison between String and number does not work as expected HOT 1
- replace mersenne twister by pcg
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from potion.