Issue with Symbol and BigInt from JavaScript
See original GitHub issueIn the following Python
code standard JavaScript
primitive types (BigInt
and Symbol
) are missed:
from browser import document, console
import javascript
n = javascript.BigInt(2) # AttributeError: 'module' object has no attribute 'BigInt'
s = javascript.Symbol("abracadabra") # AttributeError: 'module' object has no attribute 'Symbol'
Below the Stacktraces for both this lines
Missed BigInt
:
Traceback (most recent call last):
File http://localhost:63344/WebPython/index.html?_ijt=g7iau0hssgdgcripk8geh4d91s/__main__ line 17, in <module>
n = javascript.BigInt(2) # Missed BigInt symbol
AttributeError: 'module' object has no attribute 'BigInt'
brython.js:5389 Uncaught Error
at Object._b_.AttributeError.$factory (eval at $make_exc (brython.js:7929), <anonymous>:41:354)
at attr_error (brython.js:6844)
at Object.$B.$getattr (brython.js:6960)
at eval (eval at $B.loop (brython.js:5368), <anonymous>:21:41)
at $B.loop (brython.js:5368)
at idb_load (brython.js:5288)
at IDBRequest.req.onsuccess (brython.js:5302)
Missed Symbol
:
Traceback (most recent call last):
File http://localhost:63344/WebPython/index.html?_ijt=g7iau0hssgdgcripk8geh4d91s/__main__ line 17, in <module>
s = javascript.Symbol("abracadabra") # Missed Symbol symbol
AttributeError: 'module' object has no attribute 'Symbol'
brython.js:5389 Uncaught Error
at Object._b_.AttributeError.$factory (eval at $make_exc (brython.js:7929), <anonymous>:41:354)
at attr_error (brython.js:6844)
at Object.$B.$getattr (brython.js:6960)
at eval (eval at $B.loop (brython.js:5368), <anonymous>:21:41)
at $B.loop (brython.js:5368)
at idb_load (brython.js:5288)
at IDBRequest.req.onsuccess (brython.js:5302)
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
BigInt - JavaScript - MDN Web Docs
BigInt values represent numeric values which are too large to be represented by the number primitive.
Read more >The Essential Guide To JavaScript's Newest Data Type: BigInt
The BigInt data type aims to enable JavaScript programmers to represent integer values larger than the range supported by the Number data ...
Read more >BigInt in JavaScript - GeeksforGeeks
BigInt is a built-in object in JavaScript that provides a way to represent whole numbers larger than 2 53 -1.
Read more >BigInt - The Modern JavaScript Tutorial
A bigint is created by appending n to the end of an integer literal or by calling the function BigInt that creates bigints...
Read more >A guide to using BigInt - LogRocket Blog
BigInt is a relatively new numeric primitive/integer type in JavaScript. It was created to solve the limitations people ran into with the Number ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yes, it works:
Cool !! Thanks, @PierreQuentel !!