-
Notifications
You must be signed in to change notification settings - Fork 278
win fix #130
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
alex-pancho
wants to merge
87
commits into
JsInPy
Choose a base branch
from
master
base: JsInPy
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
win fix #130
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Full JavaScript INTERPRETER
such as js2py.require('crypto-js/aes')
js2py.require support subpath
Support RFC3339 dates without microseconds
Cast start argument to int in substring function
Check for object has been applied to wrong argument
… e.message , just supports str(e) and also python2+ too
|
When will this be merged? @PiotrDabkowski |
Remove nightly python tag to prevent unrelated build errors (eg due to numpy not installing).
Makes it possible to load timestamps starting from Jan 01 1900 rather than Jan 01 1970 console.log(new Date(70, 0, 1, 0, 0, 0)); console.log(new Date(Date.UTC(70, 0, 1, 6, 0, 0))); console.log(new Date(0, 0, 1, 0, 0, 0)); console.log(new Date(Date.UTC(0, 0, 1, 6, 0, 0)));
This was found in issue 215 - loading ssf.js in Windows will result in an exception in DaylightSavingTA causing it to return a fixed value and display this message:
Warning: Invalid datetime date, assumed DST time, may be inaccurate...
Here is the trace from Python 3.8.5:
Traceback (most recent call last):
File "test.py", line 28, in <module>
context.execute(js)
File "C:\Python38\Js2Py-master\js2py\evaljs.py", line 199, in execute
exec (compiled, self._context)
File "<EvalJS snippet>", line 2174, in <module>
File "C:\Python38\Js2Py-master\js2py\base.py", line 949, in __call__
return self.call(self.GlobalObject, args)
File "C:\Python38\Js2Py-master\js2py\base.py", line 1464, in call
return Js(self.code(*args))
File "<EvalJS snippet>", line 1541, in PyJs_make_ssf_0_
File "C:\Python38\Js2Py-master\js2py\constructors\jsdate.py", line 149, in date_constructor
return date_constructor2(*args)
File "C:\Python38\Js2Py-master\js2py\constructors\jsdate.py", line 181, in date_constructor2
LocalToUTC(MakeDate(MakeDay(y, m, dt), MakeTime(h, mi, sec, mili))))
File "C:\Python38\Js2Py-master\js2py\constructors\time_helpers.py", line 54, in LocalToUTC
return t - LocalTZA - DaylightSavingTA(t - LocalTZA)
File "C:\Python38\Js2Py-master\js2py\constructors\time_helpers.py", line 39, in DaylightSavingTA
LOCAL_ZONE.dst(datetime.datetime.utcfromtimestamp(
OSError: [Errno 22] Invalid argument
-> Refactored a little bit to avoid repetition
-> Leaving the explicit + ('',) because I think it shows the intent better
future releases of setuptools will not support "description-file" '''/usr/lib/python3.9/site-packages/setuptools/dist.py:642: UserWarning: Usage of dash-separated 'description-file' will not be supported in future versions. Please use the underscore name 'description_file' instead''' warning discovered on setuptools, version 56.0.0 Signed-off-by: Maciej Barć <xgqt@riseup.net>
Function translate_file uses function write_file_contents. However, function write_file_contents doesn't write Python code while using UTF-8 to encode. It will cause problems after translate JS file with special strings ( e.g., Chinese) to Python file. Error will be raised when importing objects from the Python file. Just like function get_file_contents, used codecs.open to fix the problem
These tests now pass on both the translator and the VM: - String/prototype/replace 15.5.4.11_A2_T3 - String/prototype/replace 15.5.4.11_A2_T8 See https://262.ecma-international.org/5.1/#sec-15.5.4.11 for details on this replacement string value.
efba2ac to
2e017b8
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
winfix