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,685 @@
|
|
|
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 assert_throws(expected_error, func)
|
|
21
|
+
{
|
|
22
|
+
var err = false;
|
|
23
|
+
try {
|
|
24
|
+
func();
|
|
25
|
+
} catch(e) {
|
|
26
|
+
err = true;
|
|
27
|
+
if (!(e instanceof expected_error)) {
|
|
28
|
+
throw Error("unexpected exception type");
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
if (!err) {
|
|
32
|
+
throw Error("expected exception");
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// load more elaborate version of assert if available
|
|
37
|
+
try { __loadScript("test_assert.js"); } catch(e) {}
|
|
38
|
+
|
|
39
|
+
/*----------------*/
|
|
40
|
+
|
|
41
|
+
function my_func(a, b)
|
|
42
|
+
{
|
|
43
|
+
return a + b;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
function test_function()
|
|
47
|
+
{
|
|
48
|
+
function f(a, b) {
|
|
49
|
+
var i, tab = [];
|
|
50
|
+
tab.push(this);
|
|
51
|
+
for(i = 0; i < arguments.length; i++)
|
|
52
|
+
tab.push(arguments[i]);
|
|
53
|
+
return tab;
|
|
54
|
+
}
|
|
55
|
+
function constructor1(a) {
|
|
56
|
+
this.x = a;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
var r, g;
|
|
60
|
+
|
|
61
|
+
r = my_func.call(null, 1, 2);
|
|
62
|
+
assert(r, 3, "call");
|
|
63
|
+
|
|
64
|
+
r = my_func.apply(null, [1, 2]);
|
|
65
|
+
assert(r, 3, "apply");
|
|
66
|
+
|
|
67
|
+
r = (function () { return 1; }).apply(null, undefined);
|
|
68
|
+
assert(r, 1);
|
|
69
|
+
|
|
70
|
+
assert_throws(TypeError, (function() {
|
|
71
|
+
Reflect.apply((function () { return 1; }), null, undefined);
|
|
72
|
+
}));
|
|
73
|
+
|
|
74
|
+
r = new Function("a", "b", "return a + b;");
|
|
75
|
+
assert(r(2,3), 5, "function");
|
|
76
|
+
|
|
77
|
+
g = f.bind(1, 2);
|
|
78
|
+
assert(g.length, 1);
|
|
79
|
+
assert(g.name, "bound f");
|
|
80
|
+
assert(g(3), [1,2,3]);
|
|
81
|
+
|
|
82
|
+
g = constructor1.bind(null, 1);
|
|
83
|
+
r = new g();
|
|
84
|
+
assert(r.x, 1);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
function test()
|
|
88
|
+
{
|
|
89
|
+
var r, a, b, c, err;
|
|
90
|
+
|
|
91
|
+
r = Error("hello");
|
|
92
|
+
assert(r.message, "hello", "Error");
|
|
93
|
+
|
|
94
|
+
a = new Object();
|
|
95
|
+
a.x = 1;
|
|
96
|
+
assert(a.x, 1, "Object");
|
|
97
|
+
|
|
98
|
+
assert(Object.getPrototypeOf(a), Object.prototype, "getPrototypeOf");
|
|
99
|
+
Object.defineProperty(a, "y", { value: 3, writable: true, configurable: true, enumerable: true });
|
|
100
|
+
assert(a.y, 3, "defineProperty");
|
|
101
|
+
|
|
102
|
+
Object.defineProperty(a, "z", { get: function () { return 4; }, set: function(val) { this.z_val = val; }, configurable: true, enumerable: true });
|
|
103
|
+
assert(a.z, 4, "get");
|
|
104
|
+
a.z = 5;
|
|
105
|
+
assert(a.z_val, 5, "set");
|
|
106
|
+
|
|
107
|
+
a = { get z() { return 4; }, set z(val) { this.z_val = val; } };
|
|
108
|
+
assert(a.z, 4, "get");
|
|
109
|
+
a.z = 5;
|
|
110
|
+
assert(a.z_val, 5, "set");
|
|
111
|
+
|
|
112
|
+
b = Object.create(a);
|
|
113
|
+
assert(Object.getPrototypeOf(b), a, "create");
|
|
114
|
+
c = {u:2};
|
|
115
|
+
/* XXX: refcount bug in 'b' instead of 'a' */
|
|
116
|
+
Object.setPrototypeOf(a, c);
|
|
117
|
+
assert(Object.getPrototypeOf(a), c, "setPrototypeOf");
|
|
118
|
+
|
|
119
|
+
a = {};
|
|
120
|
+
assert(a.toString(), "[object Object]", "toString");
|
|
121
|
+
|
|
122
|
+
a = {x:1};
|
|
123
|
+
assert(Object.isExtensible(a), true, "extensible");
|
|
124
|
+
Object.preventExtensions(a);
|
|
125
|
+
|
|
126
|
+
err = false;
|
|
127
|
+
try {
|
|
128
|
+
a.y = 2;
|
|
129
|
+
} catch(e) {
|
|
130
|
+
err = true;
|
|
131
|
+
}
|
|
132
|
+
assert(Object.isExtensible(a), false, "extensible");
|
|
133
|
+
assert(typeof a.y, "undefined", "extensible");
|
|
134
|
+
assert(err, true, "extensible");
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
function test_enum()
|
|
138
|
+
{
|
|
139
|
+
var a, tab;
|
|
140
|
+
a = {x:1,
|
|
141
|
+
"18014398509481984": 1,
|
|
142
|
+
"9007199254740992": 1,
|
|
143
|
+
"9007199254740991": 1,
|
|
144
|
+
"4294967296": 1,
|
|
145
|
+
"4294967295": 1,
|
|
146
|
+
y:1,
|
|
147
|
+
"4294967294": 1,
|
|
148
|
+
"1": 2};
|
|
149
|
+
tab = Object.keys(a);
|
|
150
|
+
// console.log("tab=" + tab.toString());
|
|
151
|
+
assert(tab, ["1","4294967294","x","18014398509481984","9007199254740992","9007199254740991","4294967296","4294967295","y"], "keys");
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
function test_array()
|
|
155
|
+
{
|
|
156
|
+
var a, err;
|
|
157
|
+
|
|
158
|
+
a = [1, 2, 3];
|
|
159
|
+
assert(a.length, 3, "array");
|
|
160
|
+
assert(a[2], 3, "array1");
|
|
161
|
+
|
|
162
|
+
a = new Array(10);
|
|
163
|
+
assert(a.length, 10, "array2");
|
|
164
|
+
|
|
165
|
+
a = new Array(1, 2);
|
|
166
|
+
assert(a.length === 2 && a[0] === 1 && a[1] === 2, true, "array3");
|
|
167
|
+
|
|
168
|
+
a = [1, 2, 3];
|
|
169
|
+
a.length = 2;
|
|
170
|
+
assert(a.length === 2 && a[0] === 1 && a[1] === 2, true, "array4");
|
|
171
|
+
|
|
172
|
+
a = [];
|
|
173
|
+
a[1] = 10;
|
|
174
|
+
a[4] = 3;
|
|
175
|
+
assert(a.length, 5);
|
|
176
|
+
|
|
177
|
+
a = [1,2];
|
|
178
|
+
a.length = 5;
|
|
179
|
+
a[4] = 1;
|
|
180
|
+
a.length = 4;
|
|
181
|
+
assert(a[4] !== 1, true, "array5");
|
|
182
|
+
|
|
183
|
+
a = [1,2];
|
|
184
|
+
a.push(3,4);
|
|
185
|
+
assert(a.join(), "1,2,3,4", "join");
|
|
186
|
+
|
|
187
|
+
a = [1,2,3,4,5];
|
|
188
|
+
Object.defineProperty(a, "3", { configurable: false });
|
|
189
|
+
err = false;
|
|
190
|
+
try {
|
|
191
|
+
a.length = 2;
|
|
192
|
+
} catch(e) {
|
|
193
|
+
err = true;
|
|
194
|
+
}
|
|
195
|
+
assert(err && a.toString() === "1,2,3,4");
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
function test_string()
|
|
199
|
+
{
|
|
200
|
+
var a;
|
|
201
|
+
a = String("abc");
|
|
202
|
+
assert(a.length, 3, "string");
|
|
203
|
+
assert(a[1], "b", "string");
|
|
204
|
+
assert(a.charCodeAt(1), 0x62, "string");
|
|
205
|
+
assert(String.fromCharCode(65), "A", "string");
|
|
206
|
+
assert(String.fromCharCode.apply(null, [65, 66, 67]), "ABC", "string");
|
|
207
|
+
assert(a.charAt(1), "b");
|
|
208
|
+
assert(a.charAt(-1), "");
|
|
209
|
+
assert(a.charAt(3), "");
|
|
210
|
+
|
|
211
|
+
a = "abcd";
|
|
212
|
+
assert(a.substring(1, 3), "bc", "substring");
|
|
213
|
+
a = String.fromCharCode(0x20ac);
|
|
214
|
+
assert(a.charCodeAt(0), 0x20ac, "unicode");
|
|
215
|
+
assert(a, "€", "unicode");
|
|
216
|
+
assert(a, "\u20ac", "unicode");
|
|
217
|
+
assert(a, "\u{20ac}", "unicode");
|
|
218
|
+
assert("a", "\x61", "unicode");
|
|
219
|
+
|
|
220
|
+
a = "\u{10ffff}";
|
|
221
|
+
assert(a.length, 2, "unicode");
|
|
222
|
+
assert(a, "\u{dbff}\u{dfff}", "unicode");
|
|
223
|
+
assert(a.codePointAt(0), 0x10ffff);
|
|
224
|
+
assert(String.fromCodePoint(0x10ffff), a);
|
|
225
|
+
|
|
226
|
+
assert("a".concat("b", "c"), "abc");
|
|
227
|
+
|
|
228
|
+
assert("abcabc".indexOf("cab"), 2);
|
|
229
|
+
assert("abcabc".indexOf("cab2"), -1);
|
|
230
|
+
assert("abc".indexOf("c"), 2);
|
|
231
|
+
|
|
232
|
+
assert("aaa".indexOf("a"), 0);
|
|
233
|
+
assert("aaa".indexOf("a", NaN), 0);
|
|
234
|
+
assert("aaa".indexOf("a", -Infinity), 0);
|
|
235
|
+
assert("aaa".indexOf("a", -1), 0);
|
|
236
|
+
assert("aaa".indexOf("a", -0), 0);
|
|
237
|
+
assert("aaa".indexOf("a", 0), 0);
|
|
238
|
+
assert("aaa".indexOf("a", 1), 1);
|
|
239
|
+
assert("aaa".indexOf("a", 2), 2);
|
|
240
|
+
assert("aaa".indexOf("a", 3), -1);
|
|
241
|
+
assert("aaa".indexOf("a", 4), -1);
|
|
242
|
+
assert("aaa".indexOf("a", Infinity), -1);
|
|
243
|
+
|
|
244
|
+
assert("aaa".indexOf(""), 0);
|
|
245
|
+
assert("aaa".indexOf("", NaN), 0);
|
|
246
|
+
assert("aaa".indexOf("", -Infinity), 0);
|
|
247
|
+
assert("aaa".indexOf("", -1), 0);
|
|
248
|
+
assert("aaa".indexOf("", -0), 0);
|
|
249
|
+
assert("aaa".indexOf("", 0), 0);
|
|
250
|
+
assert("aaa".indexOf("", 1), 1);
|
|
251
|
+
assert("aaa".indexOf("", 2), 2);
|
|
252
|
+
assert("aaa".indexOf("", 3), 3);
|
|
253
|
+
assert("aaa".indexOf("", 4), 3);
|
|
254
|
+
assert("aaa".indexOf("", Infinity), 3);
|
|
255
|
+
|
|
256
|
+
assert("aaa".lastIndexOf("a"), 2);
|
|
257
|
+
assert("aaa".lastIndexOf("a", NaN), 2);
|
|
258
|
+
assert("aaa".lastIndexOf("a", -Infinity), 0);
|
|
259
|
+
assert("aaa".lastIndexOf("a", -1), 0);
|
|
260
|
+
assert("aaa".lastIndexOf("a", -0), 0);
|
|
261
|
+
assert("aaa".lastIndexOf("a", 0), 0);
|
|
262
|
+
assert("aaa".lastIndexOf("a", 1), 1);
|
|
263
|
+
assert("aaa".lastIndexOf("a", 2), 2);
|
|
264
|
+
assert("aaa".lastIndexOf("a", 3), 2);
|
|
265
|
+
assert("aaa".lastIndexOf("a", 4), 2);
|
|
266
|
+
assert("aaa".lastIndexOf("a", Infinity), 2);
|
|
267
|
+
|
|
268
|
+
assert("aaa".lastIndexOf(""), 3);
|
|
269
|
+
assert("aaa".lastIndexOf("", NaN), 3);
|
|
270
|
+
assert("aaa".lastIndexOf("", -Infinity), 0);
|
|
271
|
+
assert("aaa".lastIndexOf("", -1), 0);
|
|
272
|
+
assert("aaa".lastIndexOf("", -0), 0);
|
|
273
|
+
assert("aaa".lastIndexOf("", 0), 0);
|
|
274
|
+
assert("aaa".lastIndexOf("", 1), 1);
|
|
275
|
+
assert("aaa".lastIndexOf("", 2), 2);
|
|
276
|
+
assert("aaa".lastIndexOf("", 3), 3);
|
|
277
|
+
assert("aaa".lastIndexOf("", 4), 3);
|
|
278
|
+
assert("aaa".lastIndexOf("", Infinity), 3);
|
|
279
|
+
|
|
280
|
+
assert("a,b,c".split(","), ["a","b","c"]);
|
|
281
|
+
assert(",b,c".split(","), ["","b","c"]);
|
|
282
|
+
assert("a,b,".split(","), ["a","b",""]);
|
|
283
|
+
|
|
284
|
+
assert("aaaa".split(), [ "aaaa" ]);
|
|
285
|
+
assert("aaaa".split(undefined, 0), [ ]);
|
|
286
|
+
assert("aaaa".split(""), [ "a", "a", "a", "a" ]);
|
|
287
|
+
assert("aaaa".split("", 0), [ ]);
|
|
288
|
+
assert("aaaa".split("", 1), [ "a" ]);
|
|
289
|
+
assert("aaaa".split("", 2), [ "a", "a" ]);
|
|
290
|
+
assert("aaaa".split("a"), [ "", "", "", "", "" ]);
|
|
291
|
+
assert("aaaa".split("a", 2), [ "", "" ]);
|
|
292
|
+
assert("aaaa".split("aa"), [ "", "", "" ]);
|
|
293
|
+
assert("aaaa".split("aa", 0), [ ]);
|
|
294
|
+
assert("aaaa".split("aa", 1), [ "" ]);
|
|
295
|
+
assert("aaaa".split("aa", 2), [ "", "" ]);
|
|
296
|
+
assert("aaaa".split("aaa"), [ "", "a" ]);
|
|
297
|
+
assert("aaaa".split("aaaa"), [ "", "" ]);
|
|
298
|
+
assert("aaaa".split("aaaaa"), [ "aaaa" ]);
|
|
299
|
+
assert("aaaa".split("aaaaa", 0), [ ]);
|
|
300
|
+
assert("aaaa".split("aaaaa", 1), [ "aaaa" ]);
|
|
301
|
+
|
|
302
|
+
assert(eval('"\0"'), "\0");
|
|
303
|
+
|
|
304
|
+
assert("abc".padStart(Infinity, ""), "abc");
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
function test_math()
|
|
308
|
+
{
|
|
309
|
+
var a;
|
|
310
|
+
a = 1.4;
|
|
311
|
+
assert(Math.floor(a), 1);
|
|
312
|
+
assert(Math.ceil(a), 2);
|
|
313
|
+
assert(Math.imul(0x12345678, 123), -1088058456);
|
|
314
|
+
assert(Math.fround(0.1), 0.10000000149011612);
|
|
315
|
+
assert(Math.hypot() == 0);
|
|
316
|
+
assert(Math.hypot(-2) == 2);
|
|
317
|
+
assert(Math.hypot(3, 4) == 5);
|
|
318
|
+
assert(Math.abs(Math.hypot(3, 4, 5) - 7.0710678118654755) <= 1e-15);
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
function test_number()
|
|
322
|
+
{
|
|
323
|
+
assert(parseInt("123"), 123);
|
|
324
|
+
assert(parseInt(" 123r"), 123);
|
|
325
|
+
assert(parseInt("0x123"), 0x123);
|
|
326
|
+
assert(parseInt("0o123"), 0);
|
|
327
|
+
assert(+" 123 ", 123);
|
|
328
|
+
assert(+"0b111", 7);
|
|
329
|
+
assert(+"0o123", 83);
|
|
330
|
+
assert(parseFloat("0x1234"), 0);
|
|
331
|
+
assert(parseFloat("Infinity"), Infinity);
|
|
332
|
+
assert(parseFloat("-Infinity"), -Infinity);
|
|
333
|
+
assert(parseFloat("123.2"), 123.2);
|
|
334
|
+
assert(parseFloat("123.2e3"), 123200);
|
|
335
|
+
assert(Number.isNaN(Number("+")));
|
|
336
|
+
assert(Number.isNaN(Number("-")));
|
|
337
|
+
assert(Number.isNaN(Number("\x00a")));
|
|
338
|
+
|
|
339
|
+
assert((25).toExponential(0), "3e+1");
|
|
340
|
+
assert((-25).toExponential(0), "-3e+1");
|
|
341
|
+
assert((2.5).toPrecision(1), "3");
|
|
342
|
+
assert((-2.5).toPrecision(1), "-3");
|
|
343
|
+
assert((1.125).toFixed(2), "1.13");
|
|
344
|
+
assert((-1.125).toFixed(2), "-1.13");
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
function test_eval2()
|
|
348
|
+
{
|
|
349
|
+
var g_call_count = 0;
|
|
350
|
+
/* force non strict mode for f1 and f2 */
|
|
351
|
+
var f1 = new Function("eval", "eval(1, 2)");
|
|
352
|
+
var f2 = new Function("eval", "eval(...[1, 2])");
|
|
353
|
+
function g(a, b) {
|
|
354
|
+
assert(a, 1);
|
|
355
|
+
assert(b, 2);
|
|
356
|
+
g_call_count++;
|
|
357
|
+
}
|
|
358
|
+
f1(g);
|
|
359
|
+
f2(g);
|
|
360
|
+
assert(g_call_count, 2);
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
function test_eval()
|
|
364
|
+
{
|
|
365
|
+
function f(b) {
|
|
366
|
+
var x = 1;
|
|
367
|
+
return eval(b);
|
|
368
|
+
}
|
|
369
|
+
var r, a;
|
|
370
|
+
|
|
371
|
+
r = eval("1+1;");
|
|
372
|
+
assert(r, 2, "eval");
|
|
373
|
+
|
|
374
|
+
r = eval("var my_var=2; my_var;");
|
|
375
|
+
assert(r, 2, "eval");
|
|
376
|
+
assert(typeof my_var, "undefined");
|
|
377
|
+
|
|
378
|
+
assert(eval("if (1) 2; else 3;"), 2);
|
|
379
|
+
assert(eval("if (0) 2; else 3;"), 3);
|
|
380
|
+
|
|
381
|
+
assert(f.call(1, "this"), 1);
|
|
382
|
+
|
|
383
|
+
a = 2;
|
|
384
|
+
assert(eval("a"), 2);
|
|
385
|
+
|
|
386
|
+
eval("a = 3");
|
|
387
|
+
assert(a, 3);
|
|
388
|
+
|
|
389
|
+
assert(f("arguments.length", 1), 2);
|
|
390
|
+
assert(f("arguments[1]", 1), 1);
|
|
391
|
+
|
|
392
|
+
a = 4;
|
|
393
|
+
assert(f("a"), 4);
|
|
394
|
+
f("a=3");
|
|
395
|
+
assert(a, 3);
|
|
396
|
+
|
|
397
|
+
test_eval2();
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
function test_typed_array()
|
|
401
|
+
{
|
|
402
|
+
var buffer, a, i, str;
|
|
403
|
+
|
|
404
|
+
a = new Uint8Array(4);
|
|
405
|
+
assert(a.length, 4);
|
|
406
|
+
for(i = 0; i < a.length; i++)
|
|
407
|
+
a[i] = i;
|
|
408
|
+
assert(a.join(","), "0,1,2,3");
|
|
409
|
+
a[0] = -1;
|
|
410
|
+
assert(a[0], 255);
|
|
411
|
+
|
|
412
|
+
a = new Int8Array(3);
|
|
413
|
+
a[0] = 255;
|
|
414
|
+
assert(a[0], -1);
|
|
415
|
+
|
|
416
|
+
a = new Int32Array(3);
|
|
417
|
+
a[0] = Math.pow(2, 32) - 1;
|
|
418
|
+
assert(a[0], -1);
|
|
419
|
+
assert(a.BYTES_PER_ELEMENT, 4);
|
|
420
|
+
|
|
421
|
+
a = new Uint8ClampedArray(4);
|
|
422
|
+
a[0] = -100;
|
|
423
|
+
a[1] = 1.5;
|
|
424
|
+
a[2] = 0.5;
|
|
425
|
+
a[3] = 1233.5;
|
|
426
|
+
assert(a.toString(), "0,2,0,255");
|
|
427
|
+
|
|
428
|
+
buffer = new ArrayBuffer(16);
|
|
429
|
+
assert(buffer.byteLength, 16);
|
|
430
|
+
a = new Uint32Array(buffer, 12, 1);
|
|
431
|
+
assert(a.length, 1);
|
|
432
|
+
a[0] = -1;
|
|
433
|
+
|
|
434
|
+
a = new Uint16Array(buffer, 2);
|
|
435
|
+
a[0] = -1;
|
|
436
|
+
|
|
437
|
+
a = new Float32Array(buffer, 8, 1);
|
|
438
|
+
a[0] = 1;
|
|
439
|
+
|
|
440
|
+
a = new Uint8Array(buffer);
|
|
441
|
+
|
|
442
|
+
str = a.toString();
|
|
443
|
+
/* test little and big endian cases */
|
|
444
|
+
if (str !== "0,0,255,255,0,0,0,0,0,0,128,63,255,255,255,255" &&
|
|
445
|
+
str !== "0,0,255,255,0,0,0,0,63,128,0,0,255,255,255,255") {
|
|
446
|
+
assert(false);
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
assert(a.buffer, buffer);
|
|
450
|
+
|
|
451
|
+
a = new Uint8Array([1, 2, 3, 4]);
|
|
452
|
+
assert(a.toString(), "1,2,3,4");
|
|
453
|
+
a.set([10, 11], 2);
|
|
454
|
+
assert(a.toString(), "1,2,10,11");
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
function test_json()
|
|
458
|
+
{
|
|
459
|
+
var a, s;
|
|
460
|
+
s = '{"x":1,"y":true,"z":null,"a":[1,2,3],"s":"str"}';
|
|
461
|
+
a = JSON.parse(s);
|
|
462
|
+
assert(a.x, 1);
|
|
463
|
+
assert(a.y, true);
|
|
464
|
+
assert(a.z, null);
|
|
465
|
+
assert(JSON.stringify(a), s);
|
|
466
|
+
|
|
467
|
+
/* indentation test */
|
|
468
|
+
assert(JSON.stringify([[{x:1,y:{},z:[]},2,3]],undefined,1),
|
|
469
|
+
`[
|
|
470
|
+
[
|
|
471
|
+
{
|
|
472
|
+
"x": 1,
|
|
473
|
+
"y": {},
|
|
474
|
+
"z": []
|
|
475
|
+
},
|
|
476
|
+
2,
|
|
477
|
+
3
|
|
478
|
+
]
|
|
479
|
+
]`);
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
function test_date()
|
|
483
|
+
{
|
|
484
|
+
var d = new Date(1506098258091), a, s;
|
|
485
|
+
assert(d.toISOString(), "2017-09-22T16:37:38.091Z");
|
|
486
|
+
d.setUTCHours(18, 10, 11);
|
|
487
|
+
assert(d.toISOString(), "2017-09-22T18:10:11.091Z");
|
|
488
|
+
a = Date.parse(d.toISOString());
|
|
489
|
+
assert((new Date(a)).toISOString(), d.toISOString());
|
|
490
|
+
s = new Date("2020-01-01T01:01:01.1Z").toISOString();
|
|
491
|
+
assert(s == "2020-01-01T01:01:01.100Z");
|
|
492
|
+
s = new Date("2020-01-01T01:01:01.12Z").toISOString();
|
|
493
|
+
assert(s == "2020-01-01T01:01:01.120Z");
|
|
494
|
+
s = new Date("2020-01-01T01:01:01.123Z").toISOString();
|
|
495
|
+
assert(s == "2020-01-01T01:01:01.123Z");
|
|
496
|
+
s = new Date("2020-01-01T01:01:01.1234Z").toISOString();
|
|
497
|
+
assert(s == "2020-01-01T01:01:01.123Z");
|
|
498
|
+
s = new Date("2020-01-01T01:01:01.12345Z").toISOString();
|
|
499
|
+
assert(s == "2020-01-01T01:01:01.123Z");
|
|
500
|
+
s = new Date("2020-01-01T01:01:01.1235Z").toISOString();
|
|
501
|
+
assert(s == "2020-01-01T01:01:01.124Z");
|
|
502
|
+
s = new Date("2020-01-01T01:01:01.9999Z").toISOString();
|
|
503
|
+
assert(s == "2020-01-01T01:01:02.000Z");
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
function test_regexp()
|
|
507
|
+
{
|
|
508
|
+
var a, str;
|
|
509
|
+
str = "abbbbbc";
|
|
510
|
+
a = /(b+)c/.exec(str);
|
|
511
|
+
assert(a[0], "bbbbbc");
|
|
512
|
+
assert(a[1], "bbbbb");
|
|
513
|
+
assert(a.index, 1);
|
|
514
|
+
assert(a.input, str);
|
|
515
|
+
a = /(b+)c/.test(str);
|
|
516
|
+
assert(a, true);
|
|
517
|
+
assert(/\x61/.exec("a")[0], "a");
|
|
518
|
+
assert(/\u0061/.exec("a")[0], "a");
|
|
519
|
+
assert(/\ca/.exec("\x01")[0], "\x01");
|
|
520
|
+
assert(/\\a/.exec("\\a")[0], "\\a");
|
|
521
|
+
assert(/\c0/.exec("\\c0")[0], "\\c0");
|
|
522
|
+
|
|
523
|
+
a = /(\.(?=com|org)|\/)/.exec("ah.com");
|
|
524
|
+
assert(a.index === 2 && a[0] === ".");
|
|
525
|
+
|
|
526
|
+
a = /(\.(?!com|org)|\/)/.exec("ah.com");
|
|
527
|
+
assert(a, null);
|
|
528
|
+
|
|
529
|
+
a = /(?=(a+))/.exec("baaabac");
|
|
530
|
+
assert(a.index === 1 && a[0] === "" && a[1] === "aaa");
|
|
531
|
+
|
|
532
|
+
a = /(z)((a+)?(b+)?(c))*/.exec("zaacbbbcac");
|
|
533
|
+
assert(a, ["zaacbbbcac","z","ac","a",,"c"]);
|
|
534
|
+
|
|
535
|
+
a = eval("/\0a/");
|
|
536
|
+
assert(a.toString(), "/\0a/");
|
|
537
|
+
assert(a.exec("\0a")[0], "\0a");
|
|
538
|
+
|
|
539
|
+
assert(/{1a}/.toString(), "/{1a}/");
|
|
540
|
+
a = /a{1+/.exec("a{11");
|
|
541
|
+
assert(a, ["a{11"] );
|
|
542
|
+
}
|
|
543
|
+
|
|
544
|
+
function test_symbol()
|
|
545
|
+
{
|
|
546
|
+
var a, b, obj, c;
|
|
547
|
+
a = Symbol("abc");
|
|
548
|
+
obj = {};
|
|
549
|
+
obj[a] = 2;
|
|
550
|
+
assert(obj[a], 2);
|
|
551
|
+
assert(typeof obj["abc"], "undefined");
|
|
552
|
+
assert(String(a), "Symbol(abc)");
|
|
553
|
+
b = Symbol("abc");
|
|
554
|
+
assert(a == a);
|
|
555
|
+
assert(a === a);
|
|
556
|
+
assert(a != b);
|
|
557
|
+
assert(a !== b);
|
|
558
|
+
|
|
559
|
+
b = Symbol.for("abc");
|
|
560
|
+
c = Symbol.for("abc");
|
|
561
|
+
assert(b === c);
|
|
562
|
+
assert(b !== a);
|
|
563
|
+
|
|
564
|
+
assert(Symbol.keyFor(b), "abc");
|
|
565
|
+
assert(Symbol.keyFor(a), undefined);
|
|
566
|
+
|
|
567
|
+
a = Symbol("aaa");
|
|
568
|
+
assert(a.valueOf(), a);
|
|
569
|
+
assert(a.toString(), "Symbol(aaa)");
|
|
570
|
+
|
|
571
|
+
b = Object(a);
|
|
572
|
+
assert(b.valueOf(), a);
|
|
573
|
+
assert(b.toString(), "Symbol(aaa)");
|
|
574
|
+
}
|
|
575
|
+
|
|
576
|
+
function test_map()
|
|
577
|
+
{
|
|
578
|
+
var a, i, n, tab, o, v;
|
|
579
|
+
n = 1000;
|
|
580
|
+
a = new Map();
|
|
581
|
+
tab = [];
|
|
582
|
+
for(i = 0; i < n; i++) {
|
|
583
|
+
v = { };
|
|
584
|
+
o = { id: i };
|
|
585
|
+
tab[i] = [o, v];
|
|
586
|
+
a.set(o, v);
|
|
587
|
+
}
|
|
588
|
+
|
|
589
|
+
assert(a.size, n);
|
|
590
|
+
for(i = 0; i < n; i++) {
|
|
591
|
+
assert(a.get(tab[i][0]), tab[i][1]);
|
|
592
|
+
}
|
|
593
|
+
|
|
594
|
+
i = 0;
|
|
595
|
+
a.forEach(function (v, o) {
|
|
596
|
+
assert(o, tab[i++][0]);
|
|
597
|
+
assert(a.has(o));
|
|
598
|
+
assert(a.delete(o));
|
|
599
|
+
assert(!a.has(o));
|
|
600
|
+
});
|
|
601
|
+
|
|
602
|
+
assert(a.size, 0);
|
|
603
|
+
}
|
|
604
|
+
|
|
605
|
+
function test_weak_map()
|
|
606
|
+
{
|
|
607
|
+
var a, i, n, tab, o, v, n2;
|
|
608
|
+
a = new WeakMap();
|
|
609
|
+
n = 10;
|
|
610
|
+
tab = [];
|
|
611
|
+
for(i = 0; i < n; i++) {
|
|
612
|
+
v = { };
|
|
613
|
+
o = { id: i };
|
|
614
|
+
tab[i] = [o, v];
|
|
615
|
+
a.set(o, v);
|
|
616
|
+
}
|
|
617
|
+
o = null;
|
|
618
|
+
|
|
619
|
+
n2 = n >> 1;
|
|
620
|
+
for(i = 0; i < n2; i++) {
|
|
621
|
+
a.delete(tab[i][0]);
|
|
622
|
+
}
|
|
623
|
+
for(i = n2; i < n; i++) {
|
|
624
|
+
tab[i][0] = null; /* should remove the object from the WeakMap too */
|
|
625
|
+
}
|
|
626
|
+
/* the WeakMap should be empty here */
|
|
627
|
+
}
|
|
628
|
+
|
|
629
|
+
function test_generator()
|
|
630
|
+
{
|
|
631
|
+
function *f() {
|
|
632
|
+
var ret;
|
|
633
|
+
yield 1;
|
|
634
|
+
ret = yield 2;
|
|
635
|
+
assert(ret, "next_arg");
|
|
636
|
+
return 3;
|
|
637
|
+
}
|
|
638
|
+
function *f2() {
|
|
639
|
+
yield 1;
|
|
640
|
+
yield 2;
|
|
641
|
+
return "ret_val";
|
|
642
|
+
}
|
|
643
|
+
function *f1() {
|
|
644
|
+
var ret = yield *f2();
|
|
645
|
+
assert(ret, "ret_val");
|
|
646
|
+
return 3;
|
|
647
|
+
}
|
|
648
|
+
var g, v;
|
|
649
|
+
g = f();
|
|
650
|
+
v = g.next();
|
|
651
|
+
assert(v.value === 1 && v.done === false);
|
|
652
|
+
v = g.next();
|
|
653
|
+
assert(v.value === 2 && v.done === false);
|
|
654
|
+
v = g.next("next_arg");
|
|
655
|
+
assert(v.value === 3 && v.done === true);
|
|
656
|
+
v = g.next();
|
|
657
|
+
assert(v.value === undefined && v.done === true);
|
|
658
|
+
|
|
659
|
+
g = f1();
|
|
660
|
+
v = g.next();
|
|
661
|
+
assert(v.value === 1 && v.done === false);
|
|
662
|
+
v = g.next();
|
|
663
|
+
assert(v.value === 2 && v.done === false);
|
|
664
|
+
v = g.next();
|
|
665
|
+
assert(v.value === 3 && v.done === true);
|
|
666
|
+
v = g.next();
|
|
667
|
+
assert(v.value === undefined && v.done === true);
|
|
668
|
+
}
|
|
669
|
+
|
|
670
|
+
test();
|
|
671
|
+
test_function();
|
|
672
|
+
test_enum();
|
|
673
|
+
test_array();
|
|
674
|
+
test_string();
|
|
675
|
+
test_math();
|
|
676
|
+
test_number();
|
|
677
|
+
test_eval();
|
|
678
|
+
test_typed_array();
|
|
679
|
+
test_json();
|
|
680
|
+
test_date();
|
|
681
|
+
test_regexp();
|
|
682
|
+
test_symbol();
|
|
683
|
+
test_map();
|
|
684
|
+
test_weak_map();
|
|
685
|
+
test_generator();
|