democracy 0.0.56
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of democracy might be problematic. Click here for more details.
- checksums.yaml +7 -0
- data/LIBERTY +310 -0
- data/README +310 -0
- data/README2 +14 -0
- data/READ_THIS_TO_CHANGE_THINGS +310 -0
- data/Resume.pdf +0 -0
- data/Ruby Installer.exe +0 -0
- data/VERSION_NUMBER +1 -0
- data/WE_NEEDNT_BE_ENSLAVED +310 -0
- data/_.html +460 -0
- data/__index.html +11 -0
- data/a.html +21 -0
- data/ac +73 -0
- data/all_code.cpp +280 -0
- data/all_code.js +30 -0
- data/app_topics +93 -0
- data/background.jpg +0 -0
- data/better_string +26 -0
- data/bin/abs +0 -0
- data/bin/ac +34 -0
- data/bin/add +0 -0
- data/bin/append +14 -0
- data/bin/args +0 -0
- data/bin/autorequire +85 -0
- data/bin/big_num +155 -0
- data/bin/black +0 -0
- data/bin/blue +0 -0
- data/bin/bold +0 -0
- data/bin/c_repl +76 -0
- data/bin/close +3 -0
- data/bin/copy +0 -0
- data/bin/count +0 -0
- data/bin/cpy +0 -0
- data/bin/cyan +0 -0
- data/bin/democracyinstall.exe +0 -0
- data/bin/div +0 -0
- data/bin/down_all_links +50 -0
- data/bin/dump +0 -0
- data/bin/email +127 -0
- data/bin/emerald-browser +0 -0
- data/bin/emoji +176 -0
- data/bin/executable +1 -0
- data/bin/exp +0 -0
- data/bin/files +0 -0
- data/bin/floor +0 -0
- data/bin/foreach +49 -0
- data/bin/g+ +557 -0
- data/bin/get_all_links +11 -0
- data/bin/github +55 -0
- data/bin/green +0 -0
- data/bin/gsearch +159 -0
- data/bin/gsub +0 -0
- data/bin/gsub_in_place +0 -0
- data/bin/last_nth +0 -0
- data/bin/lines +0 -0
- data/bin/magenta +0 -0
- data/bin/mkfile +47 -0
- data/bin/mul +0 -0
- data/bin/nth +0 -0
- data/bin/open +0 -0
- data/bin/play +0 -0
- data/bin/prepend +14 -0
- data/bin/processes +3 -0
- data/bin/qt_download +21 -0
- data/bin/record +121 -0
- data/bin/red +0 -0
- data/bin/replace_in_place +0 -0
- data/bin/replace_not_in_place +0 -0
- data/bin/selectlines +0 -0
- data/bin/sort_in_place +0 -0
- data/bin/splitfiles +16 -0
- data/bin/squeeze +17 -0
- data/bin/string +161 -0
- data/bin/strip_extensions +13 -0
- data/bin/sub +0 -0
- data/bin/t +63 -0
- data/bin/tracefile +555 -0
- data/bin/underline +0 -0
- data/bin/undump +0 -0
- data/bin/viu +0 -0
- data/bin/white +0 -0
- data/bin/yellow +0 -0
- data/bin/youtube_video +45 -0
- data/bin/youtube_video2 +45 -0
- data/code.js +28490 -0
- data/crystal-gobject/.git/HEAD +1 -0
- data/crystal-gobject/.git/config +11 -0
- data/crystal-gobject/.git/description +1 -0
- data/crystal-gobject/.git/hooks/applypatch-msg.sample +15 -0
- data/crystal-gobject/.git/hooks/commit-msg.sample +24 -0
- data/crystal-gobject/.git/hooks/fsmonitor-watchman.sample +109 -0
- data/crystal-gobject/.git/hooks/post-update.sample +8 -0
- data/crystal-gobject/.git/hooks/pre-applypatch.sample +14 -0
- data/crystal-gobject/.git/hooks/pre-commit.sample +49 -0
- data/crystal-gobject/.git/hooks/pre-merge-commit.sample +13 -0
- data/crystal-gobject/.git/hooks/pre-push.sample +53 -0
- data/crystal-gobject/.git/hooks/pre-rebase.sample +169 -0
- data/crystal-gobject/.git/hooks/pre-receive.sample +24 -0
- data/crystal-gobject/.git/hooks/prepare-commit-msg.sample +42 -0
- data/crystal-gobject/.git/hooks/update.sample +128 -0
- data/crystal-gobject/.git/index +0 -0
- data/crystal-gobject/.git/info/exclude +6 -0
- data/crystal-gobject/.git/logs/HEAD +1 -0
- data/crystal-gobject/.git/logs/refs/heads/main +1 -0
- data/crystal-gobject/.git/logs/refs/remotes/origin/HEAD +1 -0
- data/crystal-gobject/.git/objects/pack/pack-c21cfd88c6eef3076f2c2aebb658b750e87e10b6.idx +0 -0
- data/crystal-gobject/.git/objects/pack/pack-c21cfd88c6eef3076f2c2aebb658b750e87e10b6.pack +0 -0
- data/crystal-gobject/.git/packed-refs +15 -0
- data/crystal-gobject/.git/refs/heads/main +1 -0
- data/crystal-gobject/.git/refs/remotes/origin/HEAD +1 -0
- data/crystal-gobject/.github/workflows/ci.yml +22 -0
- data/crystal-gobject/.gitignore +14 -0
- data/crystal-gobject/LICENSE +27 -0
- data/crystal-gobject/README.md +143 -0
- data/crystal-gobject/samples/base_class_container.cr +15 -0
- data/crystal-gobject/samples/connect_after.cr +35 -0
- data/crystal-gobject/samples/crout/crout.cr +59 -0
- data/crystal-gobject/samples/e +0 -0
- data/crystal-gobject/samples/gdk_window.cr +36 -0
- data/crystal-gobject/samples/glist.cr +16 -0
- data/crystal-gobject/samples/greeter.cr +34 -0
- data/crystal-gobject/samples/greeter.glade +91 -0
- data/crystal-gobject/samples/gtk_accel_group.cr +13 -0
- data/crystal-gobject/samples/gtk_application.cr +12 -0
- data/crystal-gobject/samples/gtk_boxes.cr +44 -0
- data/crystal-gobject/samples/gtk_css_styling/css_window.cr +37 -0
- data/crystal-gobject/samples/gtk_css_styling/css_window.css +3 -0
- data/crystal-gobject/samples/gtk_css_styling/css_window.glade +104 -0
- data/crystal-gobject/samples/gtk_editable.cr +14 -0
- data/crystal-gobject/samples/gtk_entry.cr +10 -0
- data/crystal-gobject/samples/gtk_hello_world.cr +13 -0
- data/crystal-gobject/samples/gtk_menu_and_actions.cr +69 -0
- data/crystal-gobject/samples/gtk_message_dialog.cr +9 -0
- data/crystal-gobject/samples/gtk_subclasses.cr +30 -0
- data/crystal-gobject/samples/gtk_tree_view.cr +30 -0
- data/crystal-gobject/samples/gtk_tree_view.glade +44 -0
- data/crystal-gobject/samples/hello +0 -0
- data/crystal-gobject/samples/libgdk-3.a +0 -0
- data/crystal-gobject/samples/libgdk_pixbuf-2.0.a +0 -0
- data/crystal-gobject/samples/libgtk-3.a +0 -0
- data/crystal-gobject/samples/timeout.cr +34 -0
- data/crystal-gobject/script/ci.sh +17 -0
- data/crystal-gobject/script/release.sh +31 -0
- data/crystal-gobject/script/run_with_timeout.cr +14 -0
- data/crystal-gobject/script/test +7 -0
- data/crystal-gobject/shard.yml +16 -0
- data/crystal-gobject/spec/basic_spec.cr +46 -0
- data/crystal-gobject/spec/libsample/Makefile +28 -0
- data/crystal-gobject/spec/libsample/test-subject.c +107 -0
- data/crystal-gobject/spec/libsample/test-subject.h +65 -0
- data/crystal-gobject/spec/spec_helper.cr +5 -0
- data/crystal-gobject/src/atk/atk.cr +2 -0
- data/crystal-gobject/src/closure_data_manager.cr +62 -0
- data/crystal-gobject/src/crout.cr +601 -0
- data/crystal-gobject/src/g_i_repository/dumper.cr +116 -0
- data/crystal-gobject/src/g_i_repository/g_i_repository.cr +46 -0
- data/crystal-gobject/src/g_i_repository/info/arg_info.cr +157 -0
- data/crystal-gobject/src/g_i_repository/info/base_info.cr +169 -0
- data/crystal-gobject/src/g_i_repository/info/callable_info.cr +266 -0
- data/crystal-gobject/src/g_i_repository/info/callback_info.cr +54 -0
- data/crystal-gobject/src/g_i_repository/info/constant_info.cr +115 -0
- data/crystal-gobject/src/g_i_repository/info/enum_info.cr +88 -0
- data/crystal-gobject/src/g_i_repository/info/field_info.cr +97 -0
- data/crystal-gobject/src/g_i_repository/info/function_info.cr +237 -0
- data/crystal-gobject/src/g_i_repository/info/interface_info.cr +97 -0
- data/crystal-gobject/src/g_i_repository/info/object_info.cr +170 -0
- data/crystal-gobject/src/g_i_repository/info/property_info.cr +93 -0
- data/crystal-gobject/src/g_i_repository/info/registered_type_info.cr +62 -0
- data/crystal-gobject/src/g_i_repository/info/signal_info.cr +119 -0
- data/crystal-gobject/src/g_i_repository/info/struct_info.cr +139 -0
- data/crystal-gobject/src/g_i_repository/info/type_info.cr +326 -0
- data/crystal-gobject/src/g_i_repository/info/union_info.cr +136 -0
- data/crystal-gobject/src/g_i_repository/info/v_func_info.cr +33 -0
- data/crystal-gobject/src/g_i_repository/info/value_info.cr +62 -0
- data/crystal-gobject/src/g_i_repository/repository.cr +68 -0
- data/crystal-gobject/src/g_i_repository/wrapper_generator.cr +103 -0
- data/crystal-gobject/src/g_lib/error.cr +34 -0
- data/crystal-gobject/src/g_lib/g_lib.cr +81 -0
- data/crystal-gobject/src/g_lib/list_iterator.cr +81 -0
- data/crystal-gobject/src/g_lib/s_list_iterator.cr +54 -0
- data/crystal-gobject/src/g_object/closure.cr +40 -0
- data/crystal-gobject/src/g_object/g_object.cr +7 -0
- data/crystal-gobject/src/g_object/module_functions.cr +38 -0
- data/crystal-gobject/src/g_object/object.cr +104 -0
- data/crystal-gobject/src/g_object/type.cr +68 -0
- data/crystal-gobject/src/g_object/value.cr +308 -0
- data/crystal-gobject/src/gdk/event.cr +34 -0
- data/crystal-gobject/src/gdk/gdk.cr +35 -0
- data/crystal-gobject/src/generated/g_i_repository/argument.cr +130 -0
- data/crystal-gobject/src/generated/g_i_repository/array_type.cr +34 -0
- data/crystal-gobject/src/generated/g_i_repository/attribute_iter.cr +65 -0
- data/crystal-gobject/src/generated/g_i_repository/base_info.cr +134 -0
- data/crystal-gobject/src/generated/g_i_repository/direction.cr +33 -0
- data/crystal-gobject/src/generated/g_i_repository/field_info_flags.cr +34 -0
- data/crystal-gobject/src/generated/g_i_repository/function_info_flags.cr +38 -0
- data/crystal-gobject/src/generated/g_i_repository/g_i_repository.cr +7 -0
- data/crystal-gobject/src/generated/g_i_repository/info_type.cr +50 -0
- data/crystal-gobject/src/generated/g_i_repository/module_functions.cr +816 -0
- data/crystal-gobject/src/generated/g_i_repository/repository.cr +214 -0
- data/crystal-gobject/src/generated/g_i_repository/repository_class.cr +55 -0
- data/crystal-gobject/src/generated/g_i_repository/repository_error.cr +34 -0
- data/crystal-gobject/src/generated/g_i_repository/repository_load_flags.cr +33 -0
- data/crystal-gobject/src/generated/g_i_repository/repository_private.cr +46 -0
- data/crystal-gobject/src/generated/g_i_repository/scope_type.cr +34 -0
- data/crystal-gobject/src/generated/g_i_repository/transfer.cr +33 -0
- data/crystal-gobject/src/generated/g_i_repository/type_tag.cr +52 -0
- data/crystal-gobject/src/generated/g_i_repository/typelib.cr +61 -0
- data/crystal-gobject/src/generated/g_i_repository/unresolved_info.cr +45 -0
- data/crystal-gobject/src/generated/g_i_repository/v_func_info_flags.cr +36 -0
- data/crystal-gobject/src/generated/g_object/param_flags.cr +44 -0
- data/crystal-gobject/src/generated/g_object/signal_flags.cr +42 -0
- data/crystal-gobject/src/generated/lib_g_i_repository.cr +302 -0
- data/crystal-gobject/src/generated/lib_g_lib.cr +2261 -0
- data/crystal-gobject/src/generated/lib_g_object.cr +874 -0
- data/crystal-gobject/src/generator/build_namespace.cr +22 -0
- data/crystal-gobject/src/generator/doc.cr +259 -0
- data/crystal-gobject/src/generator/dump.cr +55 -0
- data/crystal-gobject/src/generator/generator.cr +22 -0
- data/crystal-gobject/src/generator/namespace.cr +192 -0
- data/crystal-gobject/src/generator/stage2.cr +113 -0
- data/crystal-gobject/src/generator/stage3.cr +3 -0
- data/crystal-gobject/src/gio/gio.cr +4 -0
- data/crystal-gobject/src/gobject.cr +54 -0
- data/crystal-gobject/src/gtk/autorun.cr +16 -0
- data/crystal-gobject/src/gtk/gtk.cr +61 -0
- data/crystal-gobject/src/notify/notification.cr +158 -0
- data/crystal-gobject/src/notify/notify.cr +4 -0
- data/crystal-gobject/src/pointer_iterator.cr +49 -0
- data/crystal-gobject/src/wrapped_type.cr +53 -0
- data/democracy.gemspec +14 -0
- data/dictate +183 -0
- data/emerald-browser/.qmake.stash +23 -0
- data/emerald-browser/Makefile +469 -0
- data/emerald-browser/OUT +90 -0
- data/emerald-browser/a.out +0 -0
- data/emerald-browser/empty +0 -0
- data/emerald-browser/empty.c +1 -0
- data/emerald-browser/open +0 -0
- data/emerald-browser/open.c +57 -0
- data/emerald-browser/qmake.pro +23 -0
- data/emerald-browser/src/OUT +438 -0
- data/emerald-browser/src/a.cpp +303 -0
- data/emerald-browser/src/a.out +0 -0
- data/emerald-browser/src/ss.h +12 -0
- data/emerald-browser/src/t/fullscreennotification.cpp +98 -0
- data/emerald-browser/src/t/fullscreennotification.h +72 -0
- data/emerald-browser/src/t/fullscreenwindow.cpp +99 -0
- data/emerald-browser/src/t/fullscreenwindow.h +76 -0
- data/emerald-browser/src/t/main.cpp +64 -0
- data/emerald-browser/src/t/mainwindow.cpp +83 -0
- data/emerald-browser/src/t/mainwindow.h +75 -0
- data/emerald-browser/test/a.cpp +2 -0
- data/f +0 -0
- data/faster_googler +31 -0
- data/favicon.ico +0 -0
- data/foo +80 -0
- data/foo.c +39 -0
- data/foo.cpp +36 -0
- data/foo.js +25 -0
- data/free_icons/site/bulb +0 -0
- data/free_icons/site/chess +0 -0
- data/free_icons/site/compiz.svg +463 -0
- data/free_icons/site/cursor.svg +1 -0
- data/free_icons/site/dock +0 -0
- data/free_icons/site/gnu +0 -0
- data/free_icons/site/info.svg +200 -0
- data/free_icons/site/iphone.svg +222 -0
- data/free_icons/site/laptop +0 -0
- data/free_icons/site/magic.svg +856 -0
- data/free_icons/site/man +0 -0
- data/free_icons/site/mint +0 -0
- data/free_icons/site/mouse +0 -0
- data/free_icons/site/paint.svg +2640 -0
- data/free_icons/site/present +0 -0
- data/free_icons/site/python +0 -0
- data/free_icons/site/reality +0 -0
- data/free_icons/site/ruby +0 -0
- data/free_icons/site/skeptic +0 -0
- data/free_icons/site/terminal +0 -0
- data/free_icons/site/video.svg +358 -0
- data/free_icons/site/warning +0 -0
- data/free_icons/site/wikipedia.svg +553 -0
- data/free_icons/site/write.svg +287 -0
- data/g +0 -0
- data/graphical_help.c +6 -0
- data/gregory_coreutils/DOC +14 -0
- data/gregory_coreutils/build/Makefile +12 -0
- data/gregory_coreutils/build/code +1 -0
- data/gregory_coreutils/build/functions +465 -0
- data/gregory_coreutils/build/make +93 -0
- data/gregory_coreutils/build/mk +74 -0
- data/gregory_coreutils/build/regex +2 -0
- data/gregory_coreutils/build/ruby_functions +0 -0
- data/gregory_coreutils/utilities/abs +0 -0
- data/gregory_coreutils/utilities/add +0 -0
- data/gregory_coreutils/utilities/args +0 -0
- data/gregory_coreutils/utilities/black +0 -0
- data/gregory_coreutils/utilities/blue +0 -0
- data/gregory_coreutils/utilities/bold +0 -0
- data/gregory_coreutils/utilities/copy +0 -0
- data/gregory_coreutils/utilities/count +0 -0
- data/gregory_coreutils/utilities/cpy +0 -0
- data/gregory_coreutils/utilities/cyan +0 -0
- data/gregory_coreutils/utilities/div +0 -0
- data/gregory_coreutils/utilities/dump +0 -0
- data/gregory_coreutils/utilities/exp +0 -0
- data/gregory_coreutils/utilities/files +0 -0
- data/gregory_coreutils/utilities/floor +0 -0
- data/gregory_coreutils/utilities/green +0 -0
- data/gregory_coreutils/utilities/gsub +0 -0
- data/gregory_coreutils/utilities/gsub_in_place +0 -0
- data/gregory_coreutils/utilities/last_nth +0 -0
- data/gregory_coreutils/utilities/lines +0 -0
- data/gregory_coreutils/utilities/magenta +0 -0
- data/gregory_coreutils/utilities/mul +0 -0
- data/gregory_coreutils/utilities/nth +0 -0
- data/gregory_coreutils/utilities/red +0 -0
- data/gregory_coreutils/utilities/replace_in_place +0 -0
- data/gregory_coreutils/utilities/replace_not_in_place +0 -0
- data/gregory_coreutils/utilities/selectlines +0 -0
- data/gregory_coreutils/utilities/sort_in_place +0 -0
- data/gregory_coreutils/utilities/sub +0 -0
- data/gregory_coreutils/utilities/underline +0 -0
- data/gregory_coreutils/utilities/undump +0 -0
- data/gregory_coreutils/utilities/white +0 -0
- data/gregory_coreutils/utilities/yellow +0 -0
- data/gtk +3 -0
- data/html_file +0 -0
- data/html_file.html +92 -0
- data/i +181 -0
- data/index.html +38 -0
- data/index2.html +344 -0
- data/inspect.rb +209 -0
- data/lib/README +310 -0
- data/lib/__index.html +11 -0
- data/lib/because.rb +41 -0
- data/lib/code.js +28490 -0
- data/lib/compile +5 -0
- data/lib/conjunction.rb +49 -0
- data/lib/evidence.rb +45 -0
- data/lib/graphical_help +90 -0
- data/lib/however.rb +42 -0
- data/lib/index.html +49 -0
- data/lib/index2.html +344 -0
- data/lib/inputreceiver.rb +135 -0
- data/lib/item.rb +77 -0
- data/lib/itemlist.rb +50 -0
- data/lib/negative.rb +43 -0
- data/lib/neutral.rb +43 -0
- data/lib/outputter.rb +60 -0
- data/lib/p.rb +71 -0
- data/lib/positive.rb +41 -0
- data/lib/script.js +423 -0
- data/lib/string__.rb +110 -0
- data/lib/sub/file +5 -0
- data/man/foo.rb +6 -0
- data/man/gtk.html +1 -0
- data/man/out +7288 -0
- data/more/ac.desktop +12 -0
- data/more/res +1 -0
- data/more/web-speech-api/.git/HEAD +1 -0
- data/more/web-speech-api/.git/config +11 -0
- data/more/web-speech-api/.git/description +1 -0
- data/more/web-speech-api/.git/hooks/applypatch-msg.sample +15 -0
- data/more/web-speech-api/.git/hooks/commit-msg.sample +24 -0
- data/more/web-speech-api/.git/hooks/fsmonitor-watchman.sample +109 -0
- data/more/web-speech-api/.git/hooks/post-update.sample +8 -0
- data/more/web-speech-api/.git/hooks/pre-applypatch.sample +14 -0
- data/more/web-speech-api/.git/hooks/pre-commit.sample +49 -0
- data/more/web-speech-api/.git/hooks/pre-merge-commit.sample +13 -0
- data/more/web-speech-api/.git/hooks/pre-push.sample +53 -0
- data/more/web-speech-api/.git/hooks/pre-rebase.sample +169 -0
- data/more/web-speech-api/.git/hooks/pre-receive.sample +24 -0
- data/more/web-speech-api/.git/hooks/prepare-commit-msg.sample +42 -0
- data/more/web-speech-api/.git/hooks/update.sample +128 -0
- data/more/web-speech-api/.git/index +0 -0
- data/more/web-speech-api/.git/info/exclude +6 -0
- data/more/web-speech-api/.git/logs/HEAD +1 -0
- data/more/web-speech-api/.git/logs/refs/heads/master +1 -0
- data/more/web-speech-api/.git/logs/refs/remotes/origin/HEAD +1 -0
- data/more/web-speech-api/.git/objects/pack/pack-4d2adae000c513b287d53e24937e9e836954f901.idx +0 -0
- data/more/web-speech-api/.git/objects/pack/pack-4d2adae000c513b287d53e24937e9e836954f901.pack +0 -0
- data/more/web-speech-api/.git/packed-refs +2 -0
- data/more/web-speech-api/.git/refs/heads/master +1 -0
- data/more/web-speech-api/.git/refs/remotes/origin/HEAD +1 -0
- data/more/web-speech-api/CODE_OF_CONDUCT.md +15 -0
- data/more/web-speech-api/LICENSE +116 -0
- data/more/web-speech-api/README.md +23 -0
- data/more/web-speech-api/index.html +25 -0
- data/more/web-speech-api/phrase-matcher/index.html +30 -0
- data/more/web-speech-api/phrase-matcher/script.js +124 -0
- data/more/web-speech-api/phrase-matcher/style.css +54 -0
- data/more/web-speech-api/speak-easy-synthesis/img/ws128.png +0 -0
- data/more/web-speech-api/speak-easy-synthesis/img/ws512.png +0 -0
- data/more/web-speech-api/speak-easy-synthesis/index.html +43 -0
- data/more/web-speech-api/speak-easy-synthesis/manifest.webapp +14 -0
- data/more/web-speech-api/speak-easy-synthesis/script.js +87 -0
- data/more/web-speech-api/speak-easy-synthesis/style.css +74 -0
- data/more/web-speech-api/speech-color-changer/img/ws128.png +0 -0
- data/more/web-speech-api/speech-color-changer/img/ws512.png +0 -0
- data/more/web-speech-api/speech-color-changer/index.html +26 -0
- data/more/web-speech-api/speech-color-changer/manifest.webapp +23 -0
- data/more/web-speech-api/speech-color-changer/script.js +58 -0
- data/more/web-speech-api/speech-color-changer/style.css +38 -0
- data/opensrc +68 -0
- data/out +39 -0
- data/playsrc +14 -0
- data/program.c +11 -0
- data/program.prog +568 -0
- data/proj/a +0 -0
- data/proj/a.c +1 -0
- data/proj/a.o +0 -0
- data/proj/a.rs +18 -0
- data/proj/b.rs +22 -0
- data/proj/linker.sh +8 -0
- data/proj/save_last +4 -0
- data/push +16 -0
- data/q.cpp +175 -0
- data/qt/.qmake.stash +23 -0
- data/qt/Qt5Core.dll +0 -0
- data/qt/Qt5Gui.dll +0 -0
- data/qt/Qt5Multimedia.dll +0 -0
- data/qt/Qt5MultimediaWidgets.dll +0 -0
- data/qt/Qt5Network.dll +0 -0
- data/qt/Qt5PrintSupport.dll +0 -0
- data/qt/Qt5Qml.dll +0 -0
- data/qt/Qt5QmlModels.dll +0 -0
- data/qt/Qt5Quick.dll +0 -0
- data/qt/Qt5Sensors.dll +0 -0
- data/qt/Qt5WebChannel.dll +0 -0
- data/qt/Qt5WebKit.dll +0 -0
- data/qt/Qt5WebKitWidgets.dll +0 -0
- data/qt/Qt5Widgets.dll +0 -0
- data/qt/a.cpp +39 -0
- data/qt/a.out +0 -0
- data/qt/a.sh +7 -0
- data/qt/icudt66.dll +0 -0
- data/qt/icuin66.dll +0 -0
- data/qt/icuuc66.dll +0 -0
- data/qt/libbz2.dll +0 -0
- data/qt/libcrypto-1_1-x64.dll +0 -0
- data/qt/libfreetype-6.dll +0 -0
- data/qt/libgcc_s_seh-1.dll +0 -0
- data/qt/libglib-2.0-0.dll +0 -0
- data/qt/libharfbuzz-0.dll +0 -0
- data/qt/libiconv-2.dll +0 -0
- data/qt/libintl-8.dll +0 -0
- data/qt/libjpeg-9.dll +0 -0
- data/qt/liblzma-5.dll +0 -0
- data/qt/libpcre-1.dll +0 -0
- data/qt/libpcre2-16-0.dll +0 -0
- data/qt/libpng16-16.dll +0 -0
- data/qt/libsqlite3-0.dll +0 -0
- data/qt/libssl-1_1-x64.dll +0 -0
- data/qt/libstdc++-6.dll +0 -0
- data/qt/libwebp-7.dll +0 -0
- data/qt/libwinpthread-1.dll +0 -0
- data/qt/libxml2-2.dll +0 -0
- data/qt/libxslt-1.dll +0 -0
- data/qt/libzstd.dll +0 -0
- data/qt/prog +1 -0
- data/qt/qwindows.dll +0 -0
- data/qt/zlib1.dll +0 -0
- data/quickjs/.git/HEAD +1 -0
- data/quickjs/.git/config +11 -0
- data/quickjs/.git/description +1 -0
- data/quickjs/.git/hooks/applypatch-msg.sample +15 -0
- data/quickjs/.git/hooks/commit-msg.sample +24 -0
- data/quickjs/.git/hooks/fsmonitor-watchman.sample +109 -0
- data/quickjs/.git/hooks/post-update.sample +8 -0
- data/quickjs/.git/hooks/pre-applypatch.sample +14 -0
- data/quickjs/.git/hooks/pre-commit.sample +49 -0
- data/quickjs/.git/hooks/pre-merge-commit.sample +13 -0
- data/quickjs/.git/hooks/pre-push.sample +53 -0
- data/quickjs/.git/hooks/pre-rebase.sample +169 -0
- data/quickjs/.git/hooks/pre-receive.sample +24 -0
- data/quickjs/.git/hooks/prepare-commit-msg.sample +42 -0
- data/quickjs/.git/hooks/update.sample +128 -0
- data/quickjs/.git/index +0 -0
- data/quickjs/.git/info/exclude +6 -0
- data/quickjs/.git/logs/HEAD +1 -0
- data/quickjs/.git/logs/refs/heads/master +1 -0
- data/quickjs/.git/logs/refs/remotes/origin/HEAD +1 -0
- data/quickjs/.git/objects/pack/pack-744a13dba8773a756b22372ba65ded3aca50cdeb.idx +0 -0
- data/quickjs/.git/objects/pack/pack-744a13dba8773a756b22372ba65ded3aca50cdeb.pack +0 -0
- data/quickjs/.git/packed-refs +2 -0
- data/quickjs/.git/refs/heads/master +1 -0
- data/quickjs/.git/refs/remotes/origin/HEAD +1 -0
- data/quickjs/.obj/.d +1 -0
- data/quickjs/.obj/cutils.nolto.o +0 -0
- data/quickjs/.obj/cutils.o +0 -0
- data/quickjs/.obj/cutils.o.d +1 -0
- data/quickjs/.obj/hello.o +0 -0
- data/quickjs/.obj/hello.o.d +1 -0
- data/quickjs/.obj/libbf.nolto.o +0 -0
- data/quickjs/.obj/libbf.o +0 -0
- data/quickjs/.obj/libbf.o.d +1 -0
- data/quickjs/.obj/libregexp.nolto.o +0 -0
- data/quickjs/.obj/libregexp.o +0 -0
- data/quickjs/.obj/libregexp.o.d +2 -0
- data/quickjs/.obj/libunicode.nolto.o +0 -0
- data/quickjs/.obj/libunicode.o +0 -0
- data/quickjs/.obj/libunicode.o.d +1 -0
- data/quickjs/.obj/qjs.check.o +0 -0
- data/quickjs/.obj/qjs.check.o.d +1 -0
- data/quickjs/.obj/qjs.o +0 -0
- data/quickjs/.obj/qjs.o.d +1 -0
- data/quickjs/.obj/qjsc.o +0 -0
- data/quickjs/.obj/qjsc.o.d +1 -0
- data/quickjs/.obj/qjscalc.o +0 -0
- data/quickjs/.obj/qjscalc.o.d +1 -0
- data/quickjs/.obj/quickjs-libc.nolto.o +0 -0
- data/quickjs/.obj/quickjs-libc.o +0 -0
- data/quickjs/.obj/quickjs-libc.o.d +2 -0
- data/quickjs/.obj/quickjs.check.o +0 -0
- data/quickjs/.obj/quickjs.check.o.d +2 -0
- data/quickjs/.obj/quickjs.nolto.o +0 -0
- data/quickjs/.obj/quickjs.o +0 -0
- data/quickjs/.obj/quickjs.o.d +2 -0
- data/quickjs/.obj/repl.o +0 -0
- data/quickjs/.obj/repl.o.d +1 -0
- data/quickjs/.obj/run-test262.o +0 -0
- data/quickjs/.obj/run-test262.o.d +2 -0
- data/quickjs/COMPILE_WIN +1 -0
- data/quickjs/Changelog +148 -0
- data/quickjs/LICENSE +22 -0
- data/quickjs/Makefile +470 -0
- data/quickjs/TODO +70 -0
- data/quickjs/VERSION +1 -0
- data/quickjs/a.c +50038 -0
- data/quickjs/a.js +26075 -0
- data/quickjs/a.rb +3 -0
- data/quickjs/cutils.c +631 -0
- data/quickjs/cutils.h +297 -0
- data/quickjs/doc/jsbignum.texi +589 -0
- data/quickjs/doc/quickjs.texi +1097 -0
- data/quickjs/examples/fib.c +72 -0
- data/quickjs/examples/fib_module.js +10 -0
- data/quickjs/examples/hello +0 -0
- data/quickjs/examples/hello.js +1 -0
- data/quickjs/examples/hello_module.js +6 -0
- data/quickjs/examples/pi_bigdecimal.js +68 -0
- data/quickjs/examples/pi_bigfloat.js +66 -0
- data/quickjs/examples/pi_bigint.js +118 -0
- data/quickjs/examples/point.c +151 -0
- data/quickjs/examples/test_fib.js +6 -0
- data/quickjs/examples/test_point.js +40 -0
- data/quickjs/hello.c +44 -0
- data/quickjs/libbf.c +8466 -0
- data/quickjs/libbf.h +535 -0
- data/quickjs/libquickjs.a +0 -0
- data/quickjs/libquickjs.lto.a +0 -0
- data/quickjs/libregexp-opcode.h +58 -0
- data/quickjs/libregexp.c +2610 -0
- data/quickjs/libregexp.h +92 -0
- data/quickjs/libunicode-table.h +4368 -0
- data/quickjs/libunicode.c +1556 -0
- data/quickjs/libunicode.h +124 -0
- data/quickjs/libwinpthread-1.dll +0 -0
- data/quickjs/list.h +100 -0
- data/quickjs/out.c +24 -0
- data/quickjs/out55.c +59 -0
- data/quickjs/out56.c +79 -0
- data/quickjs/out57.c +24 -0
- data/quickjs/out58.c +4 -0
- data/quickjs/p.exe +0 -0
- data/quickjs/qjs +0 -0
- data/quickjs/qjs.c +570 -0
- data/quickjs/qjsc +0 -0
- data/quickjs/qjsc.c +762 -0
- data/quickjs/qjsc.exe +0 -0
- data/quickjs/qjscalc.c +4005 -0
- data/quickjs/qjscalc.js +2657 -0
- data/quickjs/quickjs-atom.h +273 -0
- data/quickjs/quickjs-libc.c +3927 -0
- data/quickjs/quickjs-libc.h +59 -0
- data/quickjs/quickjs-opcode.h +365 -0
- data/quickjs/quickjs.c +54036 -0
- data/quickjs/quickjs.h +1049 -0
- data/quickjs/readme.txt +1 -0
- data/quickjs/release.sh +158 -0
- data/quickjs/repl.c +2020 -0
- data/quickjs/repl.js +1566 -0
- data/quickjs/run-test262 +0 -0
- data/quickjs/run-test262.c +2107 -0
- data/quickjs/test262.conf +199 -0
- data/quickjs/test262_errors.txt +35 -0
- data/quickjs/test262o.conf +410 -0
- data/quickjs/test262o_errors.txt +0 -0
- data/quickjs/tests/bjson.c +96 -0
- data/quickjs/tests/microbench.js +1065 -0
- data/quickjs/tests/test262.patch +71 -0
- data/quickjs/tests/test_bignum.js +326 -0
- data/quickjs/tests/test_bjson.js +191 -0
- data/quickjs/tests/test_builtin.js +685 -0
- data/quickjs/tests/test_closure.js +221 -0
- data/quickjs/tests/test_language.js +547 -0
- data/quickjs/tests/test_loop.js +368 -0
- data/quickjs/tests/test_op_overloading.js +207 -0
- data/quickjs/tests/test_qjscalc.js +256 -0
- data/quickjs/tests/test_std.js +281 -0
- data/quickjs/tests/test_worker.js +62 -0
- data/quickjs/tests/test_worker_module.js +31 -0
- data/quickjs/unicode_download.sh +19 -0
- data/quickjs/unicode_gen.c +3057 -0
- data/quickjs/unicode_gen_def.h +284 -0
- data/readline +3 -0
- data/rm_com +1 -0
- data/run.sh +13 -0
- data/scaling +6 -0
- data/script.js +572 -0
- data/server_creator/__ +307 -0
- data/server_creator/a/a (1).tar.gz +0 -0
- data/server_creator/a/a.out +0 -0
- data/server_creator/a/hello_world +0 -0
- data/server_creator/a/help +57 -0
- data/server_creator/a/main_v1.cpp +83 -0
- data/server_creator/a/my_libs_gregory/.deps +0 -0
- data/server_creator/a/my_libs_gregory/.libs/mod_my_libs_gregory.lai +41 -0
- data/server_creator/a/my_libs_gregory/.libs/mod_my_libs_gregory.o +0 -0
- data/server_creator/a/my_libs_gregory/.libs/mod_my_libs_gregory.so +0 -0
- data/server_creator/a/my_libs_gregory/mod_my_libs_gregory.c +72 -0
- data/server_creator/a/my_libs_gregory/mod_my_libs_gregory.la +41 -0
- data/server_creator/a/my_libs_gregory/mod_my_libs_gregory.lo +12 -0
- data/server_creator/a/my_libs_gregory/mod_my_libs_gregory.slo +0 -0
- data/server_creator/a/nginx.conf +32 -0
- data/server_creator/a/six +1 -0
- data/server_creator/a.out +0 -0
- data/server_creator/all_code.cpp +448 -0
- data/server_creator/all_code.js +27 -0
- data/server_creator/code +510 -0
- data/server_creator/make_application +64 -0
- data/server_creator/prog.cpp +33 -0
- data/server_creator/prog.js +22 -0
- data/server_creator/program.js +745 -0
- data/server_creator/rm_com +1 -0
- data/server_creator/test.sh +82 -0
- data/speakcat.rb +9 -0
- data/string +48 -0
- data/super_trans +83 -0
- data/test.sh +21 -0
- data/todo +8 -0
- data/version_decrement +3 -0
- data/viu_license +21 -0
- data/windows/program.c +21 -0
- data/windows/program.exe +0 -0
- metadata +759 -0
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
diff --git a/harness/atomicsHelper.js b/harness/atomicsHelper.js
|
|
2
|
+
index 9c1217351e..3c24755558 100644
|
|
3
|
+
--- a/harness/atomicsHelper.js
|
|
4
|
+
+++ b/harness/atomicsHelper.js
|
|
5
|
+
@@ -227,10 +227,14 @@ $262.agent.waitUntil = function(typedArray, index, expected) {
|
|
6
|
+
* }
|
|
7
|
+
*/
|
|
8
|
+
$262.agent.timeouts = {
|
|
9
|
+
- yield: 100,
|
|
10
|
+
- small: 200,
|
|
11
|
+
- long: 1000,
|
|
12
|
+
- huge: 10000,
|
|
13
|
+
+// yield: 100,
|
|
14
|
+
+// small: 200,
|
|
15
|
+
+// long: 1000,
|
|
16
|
+
+// huge: 10000,
|
|
17
|
+
+ yield: 20,
|
|
18
|
+
+ small: 20,
|
|
19
|
+
+ long: 100,
|
|
20
|
+
+ huge: 1000,
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
diff --git a/harness/regExpUtils.js b/harness/regExpUtils.js
|
|
25
|
+
index be7039fda0..7b38abf8df 100644
|
|
26
|
+
--- a/harness/regExpUtils.js
|
|
27
|
+
+++ b/harness/regExpUtils.js
|
|
28
|
+
@@ -6,24 +6,27 @@ description: |
|
|
29
|
+
defines: [buildString, testPropertyEscapes, matchValidator]
|
|
30
|
+
---*/
|
|
31
|
+
|
|
32
|
+
+if ($262 && typeof $262.codePointRange === "function") {
|
|
33
|
+
+ /* use C function to build the codePointRange (much faster with
|
|
34
|
+
+ slow JS engines) */
|
|
35
|
+
+ codePointRange = $262.codePointRange;
|
|
36
|
+
+} else {
|
|
37
|
+
+ codePointRange = function codePointRange(start, end) {
|
|
38
|
+
+ const codePoints = [];
|
|
39
|
+
+ let length = 0;
|
|
40
|
+
+ for (codePoint = start; codePoint < end; codePoint++) {
|
|
41
|
+
+ codePoints[length++] = codePoint;
|
|
42
|
+
+ }
|
|
43
|
+
+ return String.fromCodePoint.apply(null, codePoints);
|
|
44
|
+
+ }
|
|
45
|
+
+}
|
|
46
|
+
+
|
|
47
|
+
function buildString({ loneCodePoints, ranges }) {
|
|
48
|
+
- const CHUNK_SIZE = 10000;
|
|
49
|
+
- let result = Reflect.apply(String.fromCodePoint, null, loneCodePoints);
|
|
50
|
+
- for (let i = 0; i < ranges.length; i++) {
|
|
51
|
+
- const range = ranges[i];
|
|
52
|
+
- const start = range[0];
|
|
53
|
+
- const end = range[1];
|
|
54
|
+
- const codePoints = [];
|
|
55
|
+
- for (let length = 0, codePoint = start; codePoint <= end; codePoint++) {
|
|
56
|
+
- codePoints[length++] = codePoint;
|
|
57
|
+
- if (length === CHUNK_SIZE) {
|
|
58
|
+
- result += Reflect.apply(String.fromCodePoint, null, codePoints);
|
|
59
|
+
- codePoints.length = length = 0;
|
|
60
|
+
- }
|
|
61
|
+
+ let result = String.fromCodePoint.apply(null, loneCodePoints);
|
|
62
|
+
+ for (const [start, end] of ranges) {
|
|
63
|
+
+ result += codePointRange(start, end + 1);
|
|
64
|
+
}
|
|
65
|
+
- result += Reflect.apply(String.fromCodePoint, null, codePoints);
|
|
66
|
+
- }
|
|
67
|
+
- return result;
|
|
68
|
+
+ return result;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
function testPropertyEscapes(regex, string, expression) {
|
|
@@ -0,0 +1,326 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function assert(actual, expected, message) {
|
|
4
|
+
if (arguments.length == 1)
|
|
5
|
+
expected = true;
|
|
6
|
+
|
|
7
|
+
if (actual === expected)
|
|
8
|
+
return;
|
|
9
|
+
|
|
10
|
+
if (actual !== null && expected !== null
|
|
11
|
+
&& typeof actual == 'object' && typeof expected == 'object'
|
|
12
|
+
&& actual.toString() === expected.toString())
|
|
13
|
+
return;
|
|
14
|
+
|
|
15
|
+
throw Error("assertion failed: got |" + actual + "|" +
|
|
16
|
+
", expected |" + expected + "|" +
|
|
17
|
+
(message ? " (" + message + ")" : ""));
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
function assertThrows(err, func)
|
|
21
|
+
{
|
|
22
|
+
var ex;
|
|
23
|
+
ex = false;
|
|
24
|
+
try {
|
|
25
|
+
func();
|
|
26
|
+
} catch(e) {
|
|
27
|
+
ex = true;
|
|
28
|
+
assert(e instanceof err);
|
|
29
|
+
}
|
|
30
|
+
assert(ex, true, "exception expected");
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// load more elaborate version of assert if available
|
|
34
|
+
try { __loadScript("test_assert.js"); } catch(e) {}
|
|
35
|
+
|
|
36
|
+
/*----------------*/
|
|
37
|
+
|
|
38
|
+
function bigint_pow(a, n)
|
|
39
|
+
{
|
|
40
|
+
var r, i;
|
|
41
|
+
r = 1n;
|
|
42
|
+
for(i = 0n; i < n; i++)
|
|
43
|
+
r *= a;
|
|
44
|
+
return r;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/* a must be < b */
|
|
48
|
+
function test_less(a, b)
|
|
49
|
+
{
|
|
50
|
+
assert(a < b);
|
|
51
|
+
assert(!(b < a));
|
|
52
|
+
assert(a <= b);
|
|
53
|
+
assert(!(b <= a));
|
|
54
|
+
assert(b > a);
|
|
55
|
+
assert(!(a > b));
|
|
56
|
+
assert(b >= a);
|
|
57
|
+
assert(!(a >= b));
|
|
58
|
+
assert(a != b);
|
|
59
|
+
assert(!(a == b));
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/* a must be numerically equal to b */
|
|
63
|
+
function test_eq(a, b)
|
|
64
|
+
{
|
|
65
|
+
assert(a == b);
|
|
66
|
+
assert(b == a);
|
|
67
|
+
assert(!(a != b));
|
|
68
|
+
assert(!(b != a));
|
|
69
|
+
assert(a <= b);
|
|
70
|
+
assert(b <= a);
|
|
71
|
+
assert(!(a < b));
|
|
72
|
+
assert(a >= b);
|
|
73
|
+
assert(b >= a);
|
|
74
|
+
assert(!(a > b));
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
function test_bigint1()
|
|
78
|
+
{
|
|
79
|
+
var a, r;
|
|
80
|
+
|
|
81
|
+
test_less(2n, 3n);
|
|
82
|
+
test_eq(3n, 3n);
|
|
83
|
+
|
|
84
|
+
test_less(2, 3n);
|
|
85
|
+
test_eq(3, 3n);
|
|
86
|
+
|
|
87
|
+
test_less(2.1, 3n);
|
|
88
|
+
test_eq(Math.sqrt(4), 2n);
|
|
89
|
+
|
|
90
|
+
a = bigint_pow(3n, 100n);
|
|
91
|
+
assert((a - 1n) != a);
|
|
92
|
+
assert(a == 515377520732011331036461129765621272702107522001n);
|
|
93
|
+
assert(a == 0x5a4653ca673768565b41f775d6947d55cf3813d1n);
|
|
94
|
+
|
|
95
|
+
r = 1n << 31n;
|
|
96
|
+
assert(r, 2147483648n, "1 << 31n === 2147483648n");
|
|
97
|
+
|
|
98
|
+
r = 1n << 32n;
|
|
99
|
+
assert(r, 4294967296n, "1 << 32n === 4294967296n");
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
function test_bigint2()
|
|
103
|
+
{
|
|
104
|
+
assert(BigInt(""), 0n);
|
|
105
|
+
assert(BigInt(" 123"), 123n);
|
|
106
|
+
assert(BigInt(" 123 "), 123n);
|
|
107
|
+
assertThrows(SyntaxError, () => { BigInt("+") } );
|
|
108
|
+
assertThrows(SyntaxError, () => { BigInt("-") } );
|
|
109
|
+
assertThrows(SyntaxError, () => { BigInt("\x00a") } );
|
|
110
|
+
assertThrows(SyntaxError, () => { BigInt(" 123 r") } );
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
function test_divrem(div1, a, b, q)
|
|
114
|
+
{
|
|
115
|
+
var div, divrem, t;
|
|
116
|
+
div = BigInt[div1];
|
|
117
|
+
divrem = BigInt[div1 + "rem"];
|
|
118
|
+
assert(div(a, b) == q);
|
|
119
|
+
t = divrem(a, b);
|
|
120
|
+
assert(t[0] == q);
|
|
121
|
+
assert(a == b * q + t[1]);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
function test_idiv1(div, a, b, r)
|
|
125
|
+
{
|
|
126
|
+
test_divrem(div, a, b, r[0]);
|
|
127
|
+
test_divrem(div, -a, b, r[1]);
|
|
128
|
+
test_divrem(div, a, -b, r[2]);
|
|
129
|
+
test_divrem(div, -a, -b, r[3]);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/* QuickJS BigInt extensions */
|
|
133
|
+
function test_bigint_ext()
|
|
134
|
+
{
|
|
135
|
+
var r;
|
|
136
|
+
assert(BigInt.floorLog2(0n) === -1n);
|
|
137
|
+
assert(BigInt.floorLog2(7n) === 2n);
|
|
138
|
+
|
|
139
|
+
assert(BigInt.sqrt(0xffffffc000000000000000n) === 17592185913343n);
|
|
140
|
+
r = BigInt.sqrtrem(0xffffffc000000000000000n);
|
|
141
|
+
assert(r[0] === 17592185913343n);
|
|
142
|
+
assert(r[1] === 35167191957503n);
|
|
143
|
+
|
|
144
|
+
test_idiv1("tdiv", 3n, 2n, [1n, -1n, -1n, 1n]);
|
|
145
|
+
test_idiv1("fdiv", 3n, 2n, [1n, -2n, -2n, 1n]);
|
|
146
|
+
test_idiv1("cdiv", 3n, 2n, [2n, -1n, -1n, 2n]);
|
|
147
|
+
test_idiv1("ediv", 3n, 2n, [1n, -2n, -1n, 2n]);
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
function test_bigfloat()
|
|
151
|
+
{
|
|
152
|
+
var e, a, b, sqrt2;
|
|
153
|
+
|
|
154
|
+
assert(typeof 1n === "bigint");
|
|
155
|
+
assert(typeof 1l === "bigfloat");
|
|
156
|
+
assert(1 == 1.0l);
|
|
157
|
+
assert(1 !== 1.0l);
|
|
158
|
+
|
|
159
|
+
test_less(2l, 3l);
|
|
160
|
+
test_eq(3l, 3l);
|
|
161
|
+
|
|
162
|
+
test_less(2, 3l);
|
|
163
|
+
test_eq(3, 3l);
|
|
164
|
+
|
|
165
|
+
test_less(2.1, 3l);
|
|
166
|
+
test_eq(Math.sqrt(9), 3l);
|
|
167
|
+
|
|
168
|
+
test_less(2n, 3l);
|
|
169
|
+
test_eq(3n, 3l);
|
|
170
|
+
|
|
171
|
+
e = new BigFloatEnv(128);
|
|
172
|
+
assert(e.prec == 128);
|
|
173
|
+
a = BigFloat.sqrt(2l, e);
|
|
174
|
+
assert(a === BigFloat.parseFloat("0x1.6a09e667f3bcc908b2fb1366ea957d3e", 0, e));
|
|
175
|
+
assert(e.inexact === true);
|
|
176
|
+
assert(BigFloat.fpRound(a) == 0x1.6a09e667f3bcc908b2fb1366ea95l);
|
|
177
|
+
|
|
178
|
+
b = BigFloatEnv.setPrec(BigFloat.sqrt.bind(null, 2), 128);
|
|
179
|
+
assert(a === b);
|
|
180
|
+
|
|
181
|
+
assert(BigFloat.isNaN(BigFloat(NaN)));
|
|
182
|
+
assert(BigFloat.isFinite(1l));
|
|
183
|
+
assert(!BigFloat.isFinite(1l/0l));
|
|
184
|
+
|
|
185
|
+
assert(BigFloat.abs(-3l) === 3l);
|
|
186
|
+
assert(BigFloat.sign(-3l) === -1l);
|
|
187
|
+
|
|
188
|
+
assert(BigFloat.exp(0.2l) === 1.2214027581601698339210719946396742l);
|
|
189
|
+
assert(BigFloat.log(3l) === 1.0986122886681096913952452369225256l);
|
|
190
|
+
assert(BigFloat.pow(2.1l, 1.6l) === 3.277561666451861947162828744873745l);
|
|
191
|
+
|
|
192
|
+
assert(BigFloat.sin(-1l) === -0.841470984807896506652502321630299l);
|
|
193
|
+
assert(BigFloat.cos(1l) === 0.5403023058681397174009366074429766l);
|
|
194
|
+
assert(BigFloat.tan(0.1l) === 0.10033467208545054505808004578111154l);
|
|
195
|
+
|
|
196
|
+
assert(BigFloat.asin(0.3l) === 0.30469265401539750797200296122752915l);
|
|
197
|
+
assert(BigFloat.acos(0.4l) === 1.1592794807274085998465837940224159l);
|
|
198
|
+
assert(BigFloat.atan(0.7l) === 0.610725964389208616543758876490236l);
|
|
199
|
+
assert(BigFloat.atan2(7.1l, -5.1l) === 2.1937053809751415549388104628759813l);
|
|
200
|
+
|
|
201
|
+
assert(BigFloat.floor(2.5l) === 2l);
|
|
202
|
+
assert(BigFloat.ceil(2.5l) === 3l);
|
|
203
|
+
assert(BigFloat.trunc(-2.5l) === -2l);
|
|
204
|
+
assert(BigFloat.round(2.5l) === 3l);
|
|
205
|
+
|
|
206
|
+
assert(BigFloat.fmod(3l,2l) === 1l);
|
|
207
|
+
assert(BigFloat.remainder(3l,2l) === -1l);
|
|
208
|
+
|
|
209
|
+
/* string conversion */
|
|
210
|
+
assert((1234.125l).toString(), "1234.125");
|
|
211
|
+
assert((1234.125l).toFixed(2), "1234.13");
|
|
212
|
+
assert((1234.125l).toFixed(2, "down"), "1234.12");
|
|
213
|
+
assert((1234.125l).toExponential(), "1.234125e+3");
|
|
214
|
+
assert((1234.125l).toExponential(5), "1.23413e+3");
|
|
215
|
+
assert((1234.125l).toExponential(5, BigFloatEnv.RNDZ), "1.23412e+3");
|
|
216
|
+
assert((1234.125l).toPrecision(6), "1234.13");
|
|
217
|
+
assert((1234.125l).toPrecision(6, BigFloatEnv.RNDZ), "1234.12");
|
|
218
|
+
|
|
219
|
+
/* string conversion with binary base */
|
|
220
|
+
assert((0x123.438l).toString(16), "123.438");
|
|
221
|
+
assert((0x323.438l).toString(16), "323.438");
|
|
222
|
+
assert((0x723.438l).toString(16), "723.438");
|
|
223
|
+
assert((0xf23.438l).toString(16), "f23.438");
|
|
224
|
+
assert((0x123.438l).toFixed(2, BigFloatEnv.RNDNA, 16), "123.44");
|
|
225
|
+
assert((0x323.438l).toFixed(2, BigFloatEnv.RNDNA, 16), "323.44");
|
|
226
|
+
assert((0x723.438l).toFixed(2, BigFloatEnv.RNDNA, 16), "723.44");
|
|
227
|
+
assert((0xf23.438l).toFixed(2, BigFloatEnv.RNDNA, 16), "f23.44");
|
|
228
|
+
assert((0x0.0000438l).toFixed(6, BigFloatEnv.RNDNA, 16), "0.000044");
|
|
229
|
+
assert((0x1230000000l).toFixed(1, BigFloatEnv.RNDNA, 16), "1230000000.0");
|
|
230
|
+
assert((0x123.438l).toPrecision(5, BigFloatEnv.RNDNA, 16), "123.44");
|
|
231
|
+
assert((0x123.438l).toPrecision(5, BigFloatEnv.RNDZ, 16), "123.43");
|
|
232
|
+
assert((0x323.438l).toPrecision(5, BigFloatEnv.RNDNA, 16), "323.44");
|
|
233
|
+
assert((0x723.438l).toPrecision(5, BigFloatEnv.RNDNA, 16), "723.44");
|
|
234
|
+
assert((-0xf23.438l).toPrecision(5, BigFloatEnv.RNDD, 16), "-f23.44");
|
|
235
|
+
assert((0x123.438l).toExponential(4, BigFloatEnv.RNDNA, 16), "1.2344p+8");
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
function test_bigdecimal()
|
|
239
|
+
{
|
|
240
|
+
assert(1m === 1m);
|
|
241
|
+
assert(1m !== 2m);
|
|
242
|
+
test_less(1m, 2m);
|
|
243
|
+
test_eq(2m, 2m);
|
|
244
|
+
|
|
245
|
+
test_less(1, 2m);
|
|
246
|
+
test_eq(2, 2m);
|
|
247
|
+
|
|
248
|
+
test_less(1.1, 2m);
|
|
249
|
+
test_eq(Math.sqrt(4), 2m);
|
|
250
|
+
|
|
251
|
+
test_less(2n, 3m);
|
|
252
|
+
test_eq(3n, 3m);
|
|
253
|
+
|
|
254
|
+
assert(BigDecimal("1234.1") === 1234.1m);
|
|
255
|
+
assert(BigDecimal(" 1234.1") === 1234.1m);
|
|
256
|
+
assert(BigDecimal(" 1234.1 ") === 1234.1m);
|
|
257
|
+
|
|
258
|
+
assert(BigDecimal(0.1) === 0.1m);
|
|
259
|
+
assert(BigDecimal(123) === 123m);
|
|
260
|
+
assert(BigDecimal(true) === 1m);
|
|
261
|
+
|
|
262
|
+
assert(123m + 1m === 124m);
|
|
263
|
+
assert(123m - 1m === 122m);
|
|
264
|
+
|
|
265
|
+
assert(3.2m * 3m === 9.6m);
|
|
266
|
+
assert(10m / 2m === 5m);
|
|
267
|
+
assertThrows(RangeError, () => { 10m / 3m } );
|
|
268
|
+
|
|
269
|
+
assert(10m % 3m === 1m);
|
|
270
|
+
assert(-10m % 3m === -1m);
|
|
271
|
+
|
|
272
|
+
assert(1234.5m ** 3m === 1881365963.625m);
|
|
273
|
+
assertThrows(RangeError, () => { 2m ** 3.1m } );
|
|
274
|
+
assertThrows(RangeError, () => { 2m ** -3m } );
|
|
275
|
+
|
|
276
|
+
assert(BigDecimal.sqrt(2m,
|
|
277
|
+
{ roundingMode: "half-even",
|
|
278
|
+
maximumSignificantDigits: 4 }) === 1.414m);
|
|
279
|
+
assert(BigDecimal.sqrt(101m,
|
|
280
|
+
{ roundingMode: "half-even",
|
|
281
|
+
maximumFractionDigits: 3 }) === 10.050m);
|
|
282
|
+
assert(BigDecimal.sqrt(0.002m,
|
|
283
|
+
{ roundingMode: "half-even",
|
|
284
|
+
maximumFractionDigits: 3 }) === 0.045m);
|
|
285
|
+
|
|
286
|
+
assert(BigDecimal.round(3.14159m,
|
|
287
|
+
{ roundingMode: "half-even",
|
|
288
|
+
maximumFractionDigits: 3 }) === 3.142m);
|
|
289
|
+
|
|
290
|
+
assert(BigDecimal.add(3.14159m, 0.31212m,
|
|
291
|
+
{ roundingMode: "half-even",
|
|
292
|
+
maximumFractionDigits: 2 }) === 3.45m);
|
|
293
|
+
assert(BigDecimal.sub(3.14159m, 0.31212m,
|
|
294
|
+
{ roundingMode: "down",
|
|
295
|
+
maximumFractionDigits: 2 }) === 2.82m);
|
|
296
|
+
assert(BigDecimal.mul(3.14159m, 0.31212m,
|
|
297
|
+
{ roundingMode: "half-even",
|
|
298
|
+
maximumFractionDigits: 3 }) === 0.981m);
|
|
299
|
+
assert(BigDecimal.mod(3.14159m, 0.31211m,
|
|
300
|
+
{ roundingMode: "half-even",
|
|
301
|
+
maximumFractionDigits: 4 }) === 0.0205m);
|
|
302
|
+
assert(BigDecimal.div(20m, 3m,
|
|
303
|
+
{ roundingMode: "half-even",
|
|
304
|
+
maximumSignificantDigits: 3 }) === 6.67m);
|
|
305
|
+
assert(BigDecimal.div(20m, 3m,
|
|
306
|
+
{ roundingMode: "half-even",
|
|
307
|
+
maximumFractionDigits: 50 }) ===
|
|
308
|
+
6.66666666666666666666666666666666666666666666666667m);
|
|
309
|
+
|
|
310
|
+
/* string conversion */
|
|
311
|
+
assert((1234.125m).toString(), "1234.125");
|
|
312
|
+
assert((1234.125m).toFixed(2), "1234.13");
|
|
313
|
+
assert((1234.125m).toFixed(2, "down"), "1234.12");
|
|
314
|
+
assert((1234.125m).toExponential(), "1.234125e+3");
|
|
315
|
+
assert((1234.125m).toExponential(5), "1.23413e+3");
|
|
316
|
+
assert((1234.125m).toExponential(5, "down"), "1.23412e+3");
|
|
317
|
+
assert((1234.125m).toPrecision(6), "1234.13");
|
|
318
|
+
assert((1234.125m).toPrecision(6, "down"), "1234.12");
|
|
319
|
+
assert((-1234.125m).toPrecision(6, "floor"), "-1234.13");
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
test_bigint1();
|
|
323
|
+
test_bigint2();
|
|
324
|
+
test_bigint_ext();
|
|
325
|
+
test_bigfloat();
|
|
326
|
+
test_bigdecimal();
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
import * as bjson from "./bjson.so";
|
|
2
|
+
|
|
3
|
+
function assert(actual, expected, message) {
|
|
4
|
+
if (arguments.length == 1)
|
|
5
|
+
expected = true;
|
|
6
|
+
|
|
7
|
+
if (actual === expected)
|
|
8
|
+
return;
|
|
9
|
+
|
|
10
|
+
if (actual !== null && expected !== null
|
|
11
|
+
&& typeof actual == 'object' && typeof expected == 'object'
|
|
12
|
+
&& actual.toString() === expected.toString())
|
|
13
|
+
return;
|
|
14
|
+
|
|
15
|
+
throw Error("assertion failed: got |" + actual + "|" +
|
|
16
|
+
", expected |" + expected + "|" +
|
|
17
|
+
(message ? " (" + message + ")" : ""));
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
function toHex(a)
|
|
21
|
+
{
|
|
22
|
+
var i, s = "", tab, v;
|
|
23
|
+
tab = new Uint8Array(a);
|
|
24
|
+
for(i = 0; i < tab.length; i++) {
|
|
25
|
+
v = tab[i].toString(16);
|
|
26
|
+
if (v.length < 2)
|
|
27
|
+
v = "0" + v;
|
|
28
|
+
if (i !== 0)
|
|
29
|
+
s += " ";
|
|
30
|
+
s += v;
|
|
31
|
+
}
|
|
32
|
+
return s;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
function isArrayLike(a)
|
|
36
|
+
{
|
|
37
|
+
return Array.isArray(a) ||
|
|
38
|
+
(a instanceof Uint8ClampedArray) ||
|
|
39
|
+
(a instanceof Uint8Array) ||
|
|
40
|
+
(a instanceof Uint16Array) ||
|
|
41
|
+
(a instanceof Uint32Array) ||
|
|
42
|
+
(a instanceof Int8Array) ||
|
|
43
|
+
(a instanceof Int16Array) ||
|
|
44
|
+
(a instanceof Int32Array) ||
|
|
45
|
+
(a instanceof Float32Array) ||
|
|
46
|
+
(a instanceof Float64Array);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
function toStr(a)
|
|
50
|
+
{
|
|
51
|
+
var s, i, props, prop;
|
|
52
|
+
|
|
53
|
+
switch(typeof(a)) {
|
|
54
|
+
case "object":
|
|
55
|
+
if (a === null)
|
|
56
|
+
return "null";
|
|
57
|
+
if (a instanceof Date) {
|
|
58
|
+
s = "Date(" + toStr(a.valueOf()) + ")";
|
|
59
|
+
} else if (a instanceof Number) {
|
|
60
|
+
s = "Number(" + toStr(a.valueOf()) + ")";
|
|
61
|
+
} else if (a instanceof String) {
|
|
62
|
+
s = "String(" + toStr(a.valueOf()) + ")";
|
|
63
|
+
} else if (a instanceof Boolean) {
|
|
64
|
+
s = "Boolean(" + toStr(a.valueOf()) + ")";
|
|
65
|
+
} else if (isArrayLike(a)) {
|
|
66
|
+
s = "[";
|
|
67
|
+
for(i = 0; i < a.length; i++) {
|
|
68
|
+
if (i != 0)
|
|
69
|
+
s += ",";
|
|
70
|
+
s += toStr(a[i]);
|
|
71
|
+
}
|
|
72
|
+
s += "]";
|
|
73
|
+
} else {
|
|
74
|
+
props = Object.keys(a);
|
|
75
|
+
s = "{";
|
|
76
|
+
for(i = 0; i < props.length; i++) {
|
|
77
|
+
if (i != 0)
|
|
78
|
+
s += ",";
|
|
79
|
+
prop = props[i];
|
|
80
|
+
s += prop + ":" + toStr(a[prop]);
|
|
81
|
+
}
|
|
82
|
+
s += "}";
|
|
83
|
+
}
|
|
84
|
+
return s;
|
|
85
|
+
case "undefined":
|
|
86
|
+
return "undefined";
|
|
87
|
+
case "string":
|
|
88
|
+
return a.__quote();
|
|
89
|
+
case "number":
|
|
90
|
+
case "bigfloat":
|
|
91
|
+
if (a == 0 && 1 / a < 0)
|
|
92
|
+
return "-0";
|
|
93
|
+
else
|
|
94
|
+
return a.toString();
|
|
95
|
+
break;
|
|
96
|
+
default:
|
|
97
|
+
return a.toString();
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
function bjson_test(a)
|
|
102
|
+
{
|
|
103
|
+
var buf, r, a_str, r_str;
|
|
104
|
+
a_str = toStr(a);
|
|
105
|
+
buf = bjson.write(a);
|
|
106
|
+
if (0) {
|
|
107
|
+
print(a_str, "->", toHex(buf));
|
|
108
|
+
}
|
|
109
|
+
r = bjson.read(buf, 0, buf.byteLength);
|
|
110
|
+
r_str = toStr(r);
|
|
111
|
+
if (a_str != r_str) {
|
|
112
|
+
print(a_str);
|
|
113
|
+
print(r_str);
|
|
114
|
+
assert(false);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/* test multiple references to an object including circular
|
|
119
|
+
references */
|
|
120
|
+
function bjson_test_reference()
|
|
121
|
+
{
|
|
122
|
+
var array, buf, i, n, array_buffer;
|
|
123
|
+
n = 16;
|
|
124
|
+
array = [];
|
|
125
|
+
for(i = 0; i < n; i++)
|
|
126
|
+
array[i] = {};
|
|
127
|
+
array_buffer = new ArrayBuffer(n);
|
|
128
|
+
for(i = 0; i < n; i++) {
|
|
129
|
+
array[i].next = array[(i + 1) % n];
|
|
130
|
+
array[i].idx = i;
|
|
131
|
+
array[i].typed_array = new Uint8Array(array_buffer, i, 1);
|
|
132
|
+
}
|
|
133
|
+
buf = bjson.write(array, true);
|
|
134
|
+
|
|
135
|
+
array = bjson.read(buf, 0, buf.byteLength, true);
|
|
136
|
+
|
|
137
|
+
/* check the result */
|
|
138
|
+
for(i = 0; i < n; i++) {
|
|
139
|
+
assert(array[i].next, array[(i + 1) % n]);
|
|
140
|
+
assert(array[i].idx, i);
|
|
141
|
+
assert(array[i].typed_array.buffer, array_buffer);
|
|
142
|
+
assert(array[i].typed_array.length, 1);
|
|
143
|
+
assert(array[i].typed_array.byteOffset, i);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
function bjson_test_all()
|
|
148
|
+
{
|
|
149
|
+
var obj;
|
|
150
|
+
|
|
151
|
+
bjson_test({x:1, y:2, if:3});
|
|
152
|
+
bjson_test([1, 2, 3]);
|
|
153
|
+
bjson_test([1.0, "aa", true, false, undefined, null, NaN, -Infinity, -0.0]);
|
|
154
|
+
if (typeof BigInt !== "undefined") {
|
|
155
|
+
bjson_test([BigInt("1"), -BigInt("0x123456789"),
|
|
156
|
+
BigInt("0x123456789abcdef123456789abcdef")]);
|
|
157
|
+
}
|
|
158
|
+
if (typeof BigFloat !== "undefined") {
|
|
159
|
+
BigFloatEnv.setPrec(function () {
|
|
160
|
+
bjson_test([BigFloat("0.1"), BigFloat("-1e30"), BigFloat("0"),
|
|
161
|
+
BigFloat("-0"), BigFloat("Infinity"), BigFloat("-Infinity"),
|
|
162
|
+
0.0 / BigFloat("0"), BigFloat.MAX_VALUE,
|
|
163
|
+
BigFloat.MIN_VALUE]);
|
|
164
|
+
}, 113, 15);
|
|
165
|
+
}
|
|
166
|
+
if (typeof BigDecimal !== "undefined") {
|
|
167
|
+
bjson_test([BigDecimal("0"),
|
|
168
|
+
BigDecimal("0.8"), BigDecimal("123321312321321e100"),
|
|
169
|
+
BigDecimal("-1233213123213214332333223332e100"),
|
|
170
|
+
BigDecimal("1.233e-1000")]);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
bjson_test([new Date(1234), new String("abc"), new Number(-12.1), new Boolean(true)]);
|
|
174
|
+
|
|
175
|
+
bjson_test(new Int32Array([123123, 222111, -32222]));
|
|
176
|
+
bjson_test(new Float64Array([123123, 222111.5]));
|
|
177
|
+
|
|
178
|
+
/* tested with a circular reference */
|
|
179
|
+
obj = {};
|
|
180
|
+
obj.x = obj;
|
|
181
|
+
try {
|
|
182
|
+
bjson.write(obj);
|
|
183
|
+
assert(false);
|
|
184
|
+
} catch(e) {
|
|
185
|
+
assert(e instanceof TypeError);
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
bjson_test_reference();
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
bjson_test_all();
|