rroonga 5.0.9-x86-mingw32 → 5.1.1-x86-mingw32
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +1 -1
- data/ext/groonga/{rb-grn-conf.c → rb-grn-config.c} +18 -13
- data/ext/groonga/rb-grn-database.c +83 -0
- data/ext/groonga/rb-grn-fix-size-column.c +85 -0
- data/ext/groonga/rb-grn-index-column.c +82 -0
- data/ext/groonga/rb-grn-object.c +67 -1
- data/ext/groonga/rb-grn-table-key-support.c +87 -1
- data/ext/groonga/rb-grn-table.c +2 -2
- data/ext/groonga/rb-grn-variable-size-column.c +84 -1
- data/ext/groonga/rb-grn.h +5 -5
- data/ext/groonga/rb-groonga.c +27 -1
- data/lib/2.0/groonga.so +0 -0
- data/lib/2.1/groonga.so +0 -0
- data/lib/2.2/groonga.so +0 -0
- data/lib/2.3/groonga.so +0 -0
- data/lib/groonga/context.rb +12 -3
- data/lib/groonga/expression-builder.rb +2 -1
- data/rroonga-build.rb +6 -6
- data/test/test-accessor.rb +30 -0
- data/test/{test-conf.rb → test-config.rb} +5 -5
- data/test/test-database.rb +41 -0
- data/test/test-fix-size-column.rb +84 -0
- data/test/test-index-column.rb +71 -1
- data/test/test-package-label.rb +20 -0
- data/test/test-table-key-support.rb +42 -0
- data/test/test-table.rb +13 -0
- data/test/test-variable-size-column.rb +71 -1
- data/vendor/local/bin/grndb.exe +0 -0
- data/vendor/local/bin/groonga-benchmark.exe +0 -0
- data/vendor/local/bin/groonga.exe +0 -0
- data/vendor/local/bin/libgcc_s_sjlj-1.dll +0 -0
- data/vendor/local/bin/libgroonga-0.dll +0 -0
- data/vendor/local/bin/libmecab-1.dll +0 -0
- data/vendor/local/bin/libmsgpack-4.dll +0 -0
- data/vendor/local/bin/libmsgpackc-2.dll +0 -0
- data/vendor/local/bin/libonig-5.dll +0 -0
- data/vendor/local/bin/libstdc++-6.dll +0 -0
- data/vendor/local/bin/lz4.exe +0 -0
- data/vendor/local/bin/lz4c.exe +0 -0
- data/vendor/local/bin/lz4cat +0 -0
- data/vendor/local/bin/mecab.exe +0 -0
- data/vendor/local/bin/zlib1.dll +0 -0
- data/vendor/local/etc/groonga/httpd/groonga-httpd.conf +9 -9
- data/vendor/local/include/groonga/groonga.h +1 -0
- data/vendor/local/include/groonga/groonga/file_reader.h +40 -0
- data/vendor/local/include/groonga/groonga/groonga.h +1 -0
- data/vendor/local/include/groonga/groonga/obj.h +7 -42
- data/vendor/local/include/groonga/groonga/portability.h +4 -4
- data/vendor/local/lib/groonga/plugins/functions/vector.a +0 -0
- data/vendor/local/lib/groonga/plugins/functions/vector.dll +0 -0
- data/vendor/local/lib/groonga/plugins/functions/vector.dll.a +0 -0
- data/vendor/local/lib/groonga/plugins/query_expanders/tsv.a +0 -0
- data/vendor/local/lib/groonga/plugins/query_expanders/tsv.dll +0 -0
- data/vendor/local/lib/groonga/plugins/query_expanders/tsv.dll.a +0 -0
- data/vendor/local/lib/groonga/plugins/ruby/eval.a +0 -0
- data/vendor/local/lib/groonga/plugins/ruby/eval.dll +0 -0
- data/vendor/local/lib/groonga/plugins/ruby/eval.dll.a +0 -0
- data/vendor/local/lib/groonga/plugins/ruby/load.a +0 -0
- data/vendor/local/lib/groonga/plugins/ruby/load.dll +0 -0
- data/vendor/local/lib/groonga/plugins/ruby/load.dll.a +0 -0
- data/vendor/local/lib/groonga/plugins/sharding/logical_range_filter.rb +70 -38
- data/vendor/local/lib/groonga/plugins/suggest/suggest.a +0 -0
- data/vendor/local/lib/groonga/plugins/suggest/suggest.dll +0 -0
- data/vendor/local/lib/groonga/plugins/suggest/suggest.dll.a +0 -0
- data/vendor/local/lib/groonga/plugins/table/table.a +0 -0
- data/vendor/local/lib/groonga/plugins/table/table.dll +0 -0
- data/vendor/local/lib/groonga/plugins/table/table.dll.a +0 -0
- data/vendor/local/lib/groonga/plugins/token_filters/stop_word.a +0 -0
- data/vendor/local/lib/groonga/plugins/token_filters/stop_word.dll +0 -0
- data/vendor/local/lib/groonga/plugins/token_filters/stop_word.dll.a +0 -0
- data/vendor/local/lib/groonga/plugins/tokenizers/mecab.a +0 -0
- data/vendor/local/lib/groonga/plugins/tokenizers/mecab.dll +0 -0
- data/vendor/local/lib/groonga/plugins/tokenizers/mecab.dll.a +0 -0
- data/vendor/local/lib/groonga/scripts/ruby/command_line/grndb.rb +21 -0
- data/vendor/local/lib/groonga/scripts/ruby/id.rb +12 -0
- data/vendor/local/lib/groonga/scripts/ruby/initialize/post.rb +2 -0
- data/vendor/local/lib/groonga/scripts/ruby/logger.rb +3 -1
- data/vendor/local/lib/groonga/scripts/ruby/scan_info_data.rb +6 -0
- data/vendor/local/lib/libgroonga.a +0 -0
- data/vendor/local/lib/libgroonga.dll.a +0 -0
- data/vendor/local/lib/liblz4.a +0 -0
- data/vendor/local/lib/liblz4.dll +0 -0
- data/vendor/local/lib/liblz4.dll.1 +0 -0
- data/vendor/local/lib/liblz4.dll.1.5.0 +0 -0
- data/vendor/local/lib/libmecab.a +0 -0
- data/vendor/local/lib/libmecab.dll.a +0 -0
- data/vendor/local/lib/libmsgpack.a +0 -0
- data/vendor/local/lib/libmsgpack.dll.a +0 -0
- data/vendor/local/lib/libmsgpackc.a +0 -0
- data/vendor/local/lib/libmsgpackc.dll.a +0 -0
- data/vendor/local/lib/libonig.a +0 -0
- data/vendor/local/lib/libonig.dll.a +0 -0
- data/vendor/local/lib/libz.a +0 -0
- data/vendor/local/lib/libz.dll.a +0 -0
- data/vendor/local/lib/pkgconfig/groonga.pc +2 -2
- data/vendor/local/libexec/mecab/mecab-cost-train.exe +0 -0
- data/vendor/local/libexec/mecab/mecab-dict-gen.exe +0 -0
- data/vendor/local/libexec/mecab/mecab-dict-index.exe +0 -0
- data/vendor/local/libexec/mecab/mecab-system-eval.exe +0 -0
- data/vendor/local/libexec/mecab/mecab-test-gen.exe +0 -0
- data/vendor/local/sbin/groonga-httpd.exe +0 -0
- data/vendor/local/share/doc/groonga/en/html/.buildinfo +1 -1
- data/vendor/local/share/doc/groonga/en/html/_sources/community.txt +7 -2
- data/vendor/local/share/doc/groonga/en/html/_sources/install/centos.txt +3 -3
- data/vendor/local/share/doc/groonga/en/html/_sources/install/debian.txt +3 -3
- data/vendor/local/share/doc/groonga/en/html/_sources/install/fedora.txt +3 -3
- data/vendor/local/share/doc/groonga/en/html/_sources/install/mac_os_x.txt +3 -3
- data/vendor/local/share/doc/groonga/en/html/_sources/install/others.txt +3 -3
- data/vendor/local/share/doc/groonga/en/html/_sources/install/solaris.txt +3 -3
- data/vendor/local/share/doc/groonga/en/html/_sources/install/ubuntu.txt +4 -3
- data/vendor/local/share/doc/groonga/en/html/_sources/install/windows.txt +9 -9
- data/vendor/local/share/doc/groonga/en/html/_sources/news.txt +122 -1
- data/vendor/local/share/doc/groonga/en/html/_sources/news/4.x.txt +1 -1
- data/vendor/local/share/doc/groonga/en/html/_sources/reference/command.txt +1 -0
- data/vendor/local/share/doc/groonga/en/html/_sources/reference/command/pretty_print.txt +45 -0
- data/vendor/local/share/doc/groonga/en/html/_sources/reference/commands/lock_clear.txt +1 -1
- data/vendor/local/share/doc/groonga/en/html/_sources/reference/commands/reindex.txt +142 -0
- data/vendor/local/share/doc/groonga/en/html/_sources/reference/functions/between.txt +10 -23
- data/vendor/local/share/doc/groonga/en/html/_sources/reference/functions/geo_distance.txt +4 -4
- data/vendor/local/share/doc/groonga/en/html/_sources/reference/functions/highlight_full.txt +2 -2
- data/vendor/local/share/doc/groonga/en/html/_sources/reference/functions/highlight_html.txt +2 -2
- data/vendor/local/share/doc/groonga/en/html/_sources/reference/functions/html_untag.txt +2 -2
- data/vendor/local/share/doc/groonga/en/html/_sources/reference/functions/in_values.txt +3 -3
- data/vendor/local/share/doc/groonga/en/html/_sources/reference/functions/prefix_rk_search.txt +158 -0
- data/vendor/local/share/doc/groonga/en/html/_sources/reference/functions/query.txt +2 -2
- data/vendor/local/share/doc/groonga/en/html/_sources/reference/functions/snippet_html.txt +2 -2
- data/vendor/local/share/doc/groonga/en/html/_sources/reference/functions/sub_filter.txt +2 -2
- data/vendor/local/share/doc/groonga/en/html/_sources/reference/functions/vector_size.txt +3 -3
- data/vendor/local/share/doc/groonga/en/html/_sources/reference/operations.txt +3 -2
- data/vendor/local/share/doc/groonga/en/html/_sources/reference/operations/geolocation_search.txt +1 -2
- data/vendor/local/share/doc/groonga/en/html/_sources/reference/operations/prefix_rk_search.txt +76 -0
- data/vendor/local/share/doc/groonga/en/html/_sources/reference/suggest/completion.txt +2 -7
- data/vendor/local/share/doc/groonga/en/html/_sources/reference/tuning.txt +1 -2
- data/vendor/local/share/doc/groonga/en/html/_static/searchtools.js +37 -8
- data/vendor/local/share/doc/groonga/en/html/characteristic.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/client.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/community.html +12 -6
- data/vendor/local/share/doc/groonga/en/html/contribution.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/contribution/development.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/contribution/development/build.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/contribution/development/build/unix_autotools.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/contribution/development/build/unix_cmake.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/contribution/development/build/windows_cmake.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/contribution/development/com.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/contribution/development/cooperation.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/contribution/development/query.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/contribution/development/release.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/contribution/development/repository.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/contribution/development/test.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/contribution/documentation.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/contribution/documentation/c-api.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/contribution/documentation/i18n.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/contribution/documentation/introduction.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/contribution/report.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/development.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/development/travis-ci.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/genindex.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/index.html +72 -68
- data/vendor/local/share/doc/groonga/en/html/install.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/install/centos.html +8 -8
- data/vendor/local/share/doc/groonga/en/html/install/debian.html +8 -8
- data/vendor/local/share/doc/groonga/en/html/install/fedora.html +8 -8
- data/vendor/local/share/doc/groonga/en/html/install/mac_os_x.html +8 -8
- data/vendor/local/share/doc/groonga/en/html/install/others.html +8 -8
- data/vendor/local/share/doc/groonga/en/html/install/solaris.html +8 -8
- data/vendor/local/share/doc/groonga/en/html/install/ubuntu.html +9 -8
- data/vendor/local/share/doc/groonga/en/html/install/windows.html +14 -14
- data/vendor/local/share/doc/groonga/en/html/limitations.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/news.html +187 -76
- data/vendor/local/share/doc/groonga/en/html/news/0.x.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/news/1.0.x.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/news/1.1.x.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/news/1.2.x.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/news/1.3.x.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/news/2.x.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/news/3.x.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/news/4.x.html +7 -7
- data/vendor/local/share/doc/groonga/en/html/news/senna.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/objects.inv +0 -0
- data/vendor/local/share/doc/groonga/en/html/reference.html +72 -68
- data/vendor/local/share/doc/groonga/en/html/reference/api.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/api/global_configurations.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/api/grn_cache.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/api/grn_column.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/api/grn_command_version.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/api/grn_content_type.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/api/grn_ctx.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/api/grn_db.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/api/grn_encoding.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/api/grn_expr.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/api/grn_geo.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/api/grn_hook.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/api/grn_ii.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/api/grn_index_cursor.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/api/grn_info.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/api/grn_match_escalation.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/api/grn_obj.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/api/grn_proc.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/api/grn_search.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/api/grn_table.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/api/grn_table_cursor.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/api/grn_thread.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/api/grn_type.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/api/grn_user_data.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/api/overview.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/api/plugin.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/cast.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/column.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/columns/index.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/columns/pseudo.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/columns/scalar.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/columns/vector.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/command.html +58 -56
- data/vendor/local/share/doc/groonga/en/html/reference/command/command_version.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/command/output_format.html +10 -10
- data/vendor/local/share/doc/groonga/en/html/reference/command/pretty_print.html +183 -0
- data/vendor/local/share/doc/groonga/en/html/reference/command/request_id.html +22 -22
- data/vendor/local/share/doc/groonga/en/html/reference/command/return_code.html +21 -21
- data/vendor/local/share/doc/groonga/en/html/reference/commands/cache_limit.html +29 -29
- data/vendor/local/share/doc/groonga/en/html/reference/commands/check.html +25 -25
- data/vendor/local/share/doc/groonga/en/html/reference/commands/clearlock.html +27 -27
- data/vendor/local/share/doc/groonga/en/html/reference/commands/column_copy.html +41 -41
- data/vendor/local/share/doc/groonga/en/html/reference/commands/column_create.html +25 -25
- data/vendor/local/share/doc/groonga/en/html/reference/commands/column_list.html +31 -31
- data/vendor/local/share/doc/groonga/en/html/reference/commands/column_remove.html +25 -25
- data/vendor/local/share/doc/groonga/en/html/reference/commands/column_rename.html +33 -33
- data/vendor/local/share/doc/groonga/en/html/reference/commands/database_unmap.html +29 -29
- data/vendor/local/share/doc/groonga/en/html/reference/commands/define_selector.html +27 -27
- data/vendor/local/share/doc/groonga/en/html/reference/commands/defrag.html +25 -25
- data/vendor/local/share/doc/groonga/en/html/reference/commands/delete.html +29 -29
- data/vendor/local/share/doc/groonga/en/html/reference/commands/dump.html +37 -37
- data/vendor/local/share/doc/groonga/en/html/reference/commands/io_flush.html +33 -33
- data/vendor/local/share/doc/groonga/en/html/reference/commands/load.html +29 -29
- data/vendor/local/share/doc/groonga/en/html/reference/commands/lock_clear.html +28 -27
- data/vendor/local/share/doc/groonga/en/html/reference/commands/log_level.html +27 -27
- data/vendor/local/share/doc/groonga/en/html/reference/commands/log_put.html +27 -27
- data/vendor/local/share/doc/groonga/en/html/reference/commands/log_reopen.html +29 -29
- data/vendor/local/share/doc/groonga/en/html/reference/commands/logical_count.html +39 -39
- data/vendor/local/share/doc/groonga/en/html/reference/commands/logical_parameters.html +31 -31
- data/vendor/local/share/doc/groonga/en/html/reference/commands/logical_range_filter.html +57 -57
- data/vendor/local/share/doc/groonga/en/html/reference/commands/logical_select.html +105 -105
- data/vendor/local/share/doc/groonga/en/html/reference/commands/logical_shard_list.html +33 -33
- data/vendor/local/share/doc/groonga/en/html/reference/commands/logical_table_remove.html +37 -37
- data/vendor/local/share/doc/groonga/en/html/reference/commands/normalize.html +37 -37
- data/vendor/local/share/doc/groonga/en/html/reference/commands/normalizer_list.html +25 -25
- data/vendor/local/share/doc/groonga/en/html/reference/commands/object_exist.html +29 -29
- data/vendor/local/share/doc/groonga/en/html/reference/commands/plugin_register.html +25 -25
- data/vendor/local/share/doc/groonga/en/html/reference/commands/plugin_unregister.html +25 -25
- data/vendor/local/share/doc/groonga/en/html/reference/commands/quit.html +25 -25
- data/vendor/local/share/doc/groonga/en/html/reference/commands/range_filter.html +25 -25
- data/vendor/local/share/doc/groonga/en/html/reference/commands/register.html +26 -26
- data/vendor/local/share/doc/groonga/en/html/reference/commands/reindex.html +279 -0
- data/vendor/local/share/doc/groonga/en/html/reference/commands/request_cancel.html +32 -32
- data/vendor/local/share/doc/groonga/en/html/reference/commands/ruby_eval.html +29 -29
- data/vendor/local/share/doc/groonga/en/html/reference/commands/ruby_load.html +29 -29
- data/vendor/local/share/doc/groonga/en/html/reference/commands/select.html +107 -107
- data/vendor/local/share/doc/groonga/en/html/reference/commands/shutdown.html +25 -25
- data/vendor/local/share/doc/groonga/en/html/reference/commands/status.html +29 -29
- data/vendor/local/share/doc/groonga/en/html/reference/commands/suggest.html +27 -27
- data/vendor/local/share/doc/groonga/en/html/reference/commands/table_create.html +49 -49
- data/vendor/local/share/doc/groonga/en/html/reference/commands/table_list.html +25 -25
- data/vendor/local/share/doc/groonga/en/html/reference/commands/table_remove.html +35 -35
- data/vendor/local/share/doc/groonga/en/html/reference/commands/table_rename.html +31 -31
- data/vendor/local/share/doc/groonga/en/html/reference/commands/table_tokenize.html +39 -39
- data/vendor/local/share/doc/groonga/en/html/reference/commands/thread_limit.html +31 -31
- data/vendor/local/share/doc/groonga/en/html/reference/commands/tokenize.html +43 -43
- data/vendor/local/share/doc/groonga/en/html/reference/commands/tokenizer_list.html +25 -25
- data/vendor/local/share/doc/groonga/en/html/reference/commands/truncate.html +25 -25
- data/vendor/local/share/doc/groonga/en/html/reference/executables.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/executables/grndb.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/executables/grnslap.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/executables/groonga-benchmark.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/executables/groonga-httpd.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/executables/groonga-server-http.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/executables/groonga-suggest-create-dataset.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/executables/groonga-suggest-httpd.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/executables/groonga-suggest-learner.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/executables/groonga.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/function.html +18 -17
- data/vendor/local/share/doc/groonga/en/html/reference/functions/between.html +14 -8
- data/vendor/local/share/doc/groonga/en/html/reference/functions/edit_distance.html +7 -7
- data/vendor/local/share/doc/groonga/en/html/reference/functions/geo_distance.html +7 -7
- data/vendor/local/share/doc/groonga/en/html/reference/functions/geo_in_circle.html +6 -6
- data/vendor/local/share/doc/groonga/en/html/reference/functions/geo_in_rectangle.html +6 -6
- data/vendor/local/share/doc/groonga/en/html/reference/functions/highlight_full.html +8 -8
- data/vendor/local/share/doc/groonga/en/html/reference/functions/highlight_html.html +9 -9
- data/vendor/local/share/doc/groonga/en/html/reference/functions/html_untag.html +9 -9
- data/vendor/local/share/doc/groonga/en/html/reference/functions/in_values.html +8 -8
- data/vendor/local/share/doc/groonga/en/html/reference/functions/now.html +11 -11
- data/vendor/local/share/doc/groonga/en/html/reference/functions/prefix_rk_search.html +434 -0
- data/vendor/local/share/doc/groonga/en/html/reference/functions/query.html +42 -42
- data/vendor/local/share/doc/groonga/en/html/reference/functions/rand.html +27 -27
- data/vendor/local/share/doc/groonga/en/html/reference/functions/snippet_html.html +27 -27
- data/vendor/local/share/doc/groonga/en/html/reference/functions/sub_filter.html +31 -31
- data/vendor/local/share/doc/groonga/en/html/reference/functions/vector_size.html +23 -23
- data/vendor/local/share/doc/groonga/en/html/reference/grn_expr.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/grn_expr/query_syntax.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/grn_expr/script_syntax.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/indexing.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/log.html +9 -9
- data/vendor/local/share/doc/groonga/en/html/reference/normalizers.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/operations.html +15 -17
- data/vendor/local/share/doc/groonga/en/html/reference/operations/geolocation_search.html +12 -12
- data/vendor/local/share/doc/groonga/en/html/reference/operations/prefix_rk_search.html +203 -0
- data/vendor/local/share/doc/groonga/en/html/reference/output.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/query_expanders.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/query_expanders/tsv.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/regular_expression.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/scorer.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/scorers/scorer_tf_at_most.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/scorers/scorer_tf_idf.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/sharding.html +15 -15
- data/vendor/local/share/doc/groonga/en/html/reference/suggest.html +10 -10
- data/vendor/local/share/doc/groonga/en/html/reference/suggest/completion.html +7 -11
- data/vendor/local/share/doc/groonga/en/html/reference/suggest/correction.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/suggest/introduction.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/suggest/suggestion.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/tables.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/token_filters.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/tokenizers.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/tuning.html +6 -6
- data/vendor/local/share/doc/groonga/en/html/reference/types.html +9 -9
- data/vendor/local/share/doc/groonga/en/html/search.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/searchindex.js +1 -1
- data/vendor/local/share/doc/groonga/en/html/server.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/server/gqtp.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/server/http.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/server/http/comparison.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/server/http/groonga-httpd.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/server/http/groonga.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/server/memcached.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/server/package.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/spec.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/spec/gqtp.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/spec/search.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/troubleshooting.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/troubleshooting/different_results_with_the_same_keyword.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/troubleshooting/mmap_cannot_allocate_memory.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/tutorial.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/tutorial/data.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/tutorial/drilldown.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/tutorial/index.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/tutorial/introduction.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/tutorial/lexicon.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/tutorial/match_columns.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/tutorial/micro_blog.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/tutorial/network.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/tutorial/patricia_trie.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/tutorial/query_expansion.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/tutorial/search.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/.buildinfo +1 -1
- data/vendor/local/share/doc/groonga/ja/html/_sources/community.txt +7 -2
- data/vendor/local/share/doc/groonga/ja/html/_sources/install/centos.txt +3 -3
- data/vendor/local/share/doc/groonga/ja/html/_sources/install/debian.txt +3 -3
- data/vendor/local/share/doc/groonga/ja/html/_sources/install/fedora.txt +3 -3
- data/vendor/local/share/doc/groonga/ja/html/_sources/install/mac_os_x.txt +3 -3
- data/vendor/local/share/doc/groonga/ja/html/_sources/install/others.txt +3 -3
- data/vendor/local/share/doc/groonga/ja/html/_sources/install/solaris.txt +3 -3
- data/vendor/local/share/doc/groonga/ja/html/_sources/install/ubuntu.txt +4 -3
- data/vendor/local/share/doc/groonga/ja/html/_sources/install/windows.txt +9 -9
- data/vendor/local/share/doc/groonga/ja/html/_sources/news.txt +122 -1
- data/vendor/local/share/doc/groonga/ja/html/_sources/news/4.x.txt +1 -1
- data/vendor/local/share/doc/groonga/ja/html/_sources/reference/command.txt +1 -0
- data/vendor/local/share/doc/groonga/ja/html/_sources/reference/command/pretty_print.txt +45 -0
- data/vendor/local/share/doc/groonga/ja/html/_sources/reference/commands/lock_clear.txt +1 -1
- data/vendor/local/share/doc/groonga/ja/html/_sources/reference/commands/reindex.txt +142 -0
- data/vendor/local/share/doc/groonga/ja/html/_sources/reference/functions/between.txt +10 -23
- data/vendor/local/share/doc/groonga/ja/html/_sources/reference/functions/geo_distance.txt +4 -4
- data/vendor/local/share/doc/groonga/ja/html/_sources/reference/functions/highlight_full.txt +2 -2
- data/vendor/local/share/doc/groonga/ja/html/_sources/reference/functions/highlight_html.txt +2 -2
- data/vendor/local/share/doc/groonga/ja/html/_sources/reference/functions/html_untag.txt +2 -2
- data/vendor/local/share/doc/groonga/ja/html/_sources/reference/functions/in_values.txt +3 -3
- data/vendor/local/share/doc/groonga/ja/html/_sources/reference/functions/prefix_rk_search.txt +158 -0
- data/vendor/local/share/doc/groonga/ja/html/_sources/reference/functions/query.txt +2 -2
- data/vendor/local/share/doc/groonga/ja/html/_sources/reference/functions/snippet_html.txt +2 -2
- data/vendor/local/share/doc/groonga/ja/html/_sources/reference/functions/sub_filter.txt +2 -2
- data/vendor/local/share/doc/groonga/ja/html/_sources/reference/functions/vector_size.txt +3 -3
- data/vendor/local/share/doc/groonga/ja/html/_sources/reference/operations.txt +3 -2
- data/vendor/local/share/doc/groonga/ja/html/_sources/reference/operations/geolocation_search.txt +1 -2
- data/vendor/local/share/doc/groonga/ja/html/_sources/reference/operations/prefix_rk_search.txt +76 -0
- data/vendor/local/share/doc/groonga/ja/html/_sources/reference/suggest/completion.txt +2 -7
- data/vendor/local/share/doc/groonga/ja/html/_sources/reference/tuning.txt +1 -2
- data/vendor/local/share/doc/groonga/ja/html/_static/searchtools.js +37 -8
- data/vendor/local/share/doc/groonga/ja/html/characteristic.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/client.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/community.html +14 -6
- data/vendor/local/share/doc/groonga/ja/html/contribution.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/contribution/development.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/contribution/development/build.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/contribution/development/build/unix_autotools.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/contribution/development/build/unix_cmake.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/contribution/development/build/windows_cmake.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/contribution/development/com.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/contribution/development/cooperation.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/contribution/development/query.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/contribution/development/release.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/contribution/development/repository.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/contribution/development/test.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/contribution/documentation.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/contribution/documentation/c-api.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/contribution/documentation/i18n.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/contribution/documentation/introduction.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/contribution/report.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/development.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/development/travis-ci.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/genindex.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/index.html +71 -67
- data/vendor/local/share/doc/groonga/ja/html/install.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/install/centos.html +8 -8
- data/vendor/local/share/doc/groonga/ja/html/install/debian.html +8 -8
- data/vendor/local/share/doc/groonga/ja/html/install/fedora.html +8 -8
- data/vendor/local/share/doc/groonga/ja/html/install/mac_os_x.html +8 -8
- data/vendor/local/share/doc/groonga/ja/html/install/others.html +8 -8
- data/vendor/local/share/doc/groonga/ja/html/install/solaris.html +8 -8
- data/vendor/local/share/doc/groonga/ja/html/install/ubuntu.html +9 -8
- data/vendor/local/share/doc/groonga/ja/html/install/windows.html +14 -14
- data/vendor/local/share/doc/groonga/ja/html/limitations.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/news.html +188 -76
- data/vendor/local/share/doc/groonga/ja/html/news/0.x.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/news/1.0.x.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/news/1.1.x.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/news/1.2.x.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/news/1.3.x.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/news/2.x.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/news/3.x.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/news/4.x.html +6 -6
- data/vendor/local/share/doc/groonga/ja/html/news/senna.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/objects.inv +0 -0
- data/vendor/local/share/doc/groonga/ja/html/reference.html +71 -67
- data/vendor/local/share/doc/groonga/ja/html/reference/api.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/api/global_configurations.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/api/grn_cache.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/api/grn_column.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/api/grn_command_version.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/api/grn_content_type.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/api/grn_ctx.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/api/grn_db.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/api/grn_encoding.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/api/grn_expr.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/api/grn_geo.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/api/grn_hook.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/api/grn_ii.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/api/grn_index_cursor.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/api/grn_info.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/api/grn_match_escalation.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/api/grn_obj.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/api/grn_proc.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/api/grn_search.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/api/grn_table.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/api/grn_table_cursor.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/api/grn_thread.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/api/grn_type.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/api/grn_user_data.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/api/overview.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/api/plugin.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/cast.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/column.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/columns/index.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/columns/pseudo.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/columns/scalar.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/columns/vector.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/command.html +58 -56
- data/vendor/local/share/doc/groonga/ja/html/reference/command/command_version.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/command/output_format.html +12 -11
- data/vendor/local/share/doc/groonga/ja/html/reference/command/pretty_print.html +183 -0
- data/vendor/local/share/doc/groonga/ja/html/reference/command/request_id.html +28 -33
- data/vendor/local/share/doc/groonga/ja/html/reference/command/return_code.html +21 -21
- data/vendor/local/share/doc/groonga/ja/html/reference/commands/cache_limit.html +29 -29
- data/vendor/local/share/doc/groonga/ja/html/reference/commands/check.html +25 -25
- data/vendor/local/share/doc/groonga/ja/html/reference/commands/clearlock.html +27 -27
- data/vendor/local/share/doc/groonga/ja/html/reference/commands/column_copy.html +41 -41
- data/vendor/local/share/doc/groonga/ja/html/reference/commands/column_create.html +25 -25
- data/vendor/local/share/doc/groonga/ja/html/reference/commands/column_list.html +31 -31
- data/vendor/local/share/doc/groonga/ja/html/reference/commands/column_remove.html +25 -25
- data/vendor/local/share/doc/groonga/ja/html/reference/commands/column_rename.html +33 -33
- data/vendor/local/share/doc/groonga/ja/html/reference/commands/database_unmap.html +29 -29
- data/vendor/local/share/doc/groonga/ja/html/reference/commands/define_selector.html +27 -27
- data/vendor/local/share/doc/groonga/ja/html/reference/commands/defrag.html +25 -25
- data/vendor/local/share/doc/groonga/ja/html/reference/commands/delete.html +29 -29
- data/vendor/local/share/doc/groonga/ja/html/reference/commands/dump.html +37 -37
- data/vendor/local/share/doc/groonga/ja/html/reference/commands/io_flush.html +33 -33
- data/vendor/local/share/doc/groonga/ja/html/reference/commands/load.html +31 -31
- data/vendor/local/share/doc/groonga/ja/html/reference/commands/lock_clear.html +33 -37
- data/vendor/local/share/doc/groonga/ja/html/reference/commands/log_level.html +27 -27
- data/vendor/local/share/doc/groonga/ja/html/reference/commands/log_put.html +27 -27
- data/vendor/local/share/doc/groonga/ja/html/reference/commands/log_reopen.html +29 -29
- data/vendor/local/share/doc/groonga/ja/html/reference/commands/logical_count.html +39 -39
- data/vendor/local/share/doc/groonga/ja/html/reference/commands/logical_parameters.html +31 -31
- data/vendor/local/share/doc/groonga/ja/html/reference/commands/logical_range_filter.html +57 -57
- data/vendor/local/share/doc/groonga/ja/html/reference/commands/logical_select.html +105 -105
- data/vendor/local/share/doc/groonga/ja/html/reference/commands/logical_shard_list.html +33 -33
- data/vendor/local/share/doc/groonga/ja/html/reference/commands/logical_table_remove.html +37 -37
- data/vendor/local/share/doc/groonga/ja/html/reference/commands/normalize.html +37 -37
- data/vendor/local/share/doc/groonga/ja/html/reference/commands/normalizer_list.html +25 -25
- data/vendor/local/share/doc/groonga/ja/html/reference/commands/object_exist.html +29 -29
- data/vendor/local/share/doc/groonga/ja/html/reference/commands/plugin_register.html +25 -25
- data/vendor/local/share/doc/groonga/ja/html/reference/commands/plugin_unregister.html +25 -25
- data/vendor/local/share/doc/groonga/ja/html/reference/commands/quit.html +25 -25
- data/vendor/local/share/doc/groonga/ja/html/reference/commands/range_filter.html +25 -25
- data/vendor/local/share/doc/groonga/ja/html/reference/commands/register.html +26 -26
- data/vendor/local/share/doc/groonga/ja/html/reference/commands/reindex.html +267 -0
- data/vendor/local/share/doc/groonga/ja/html/reference/commands/request_cancel.html +32 -32
- data/vendor/local/share/doc/groonga/ja/html/reference/commands/ruby_eval.html +29 -29
- data/vendor/local/share/doc/groonga/ja/html/reference/commands/ruby_load.html +29 -29
- data/vendor/local/share/doc/groonga/ja/html/reference/commands/select.html +107 -107
- data/vendor/local/share/doc/groonga/ja/html/reference/commands/shutdown.html +25 -25
- data/vendor/local/share/doc/groonga/ja/html/reference/commands/status.html +29 -29
- data/vendor/local/share/doc/groonga/ja/html/reference/commands/suggest.html +31 -31
- data/vendor/local/share/doc/groonga/ja/html/reference/commands/table_create.html +49 -49
- data/vendor/local/share/doc/groonga/ja/html/reference/commands/table_list.html +25 -25
- data/vendor/local/share/doc/groonga/ja/html/reference/commands/table_remove.html +35 -35
- data/vendor/local/share/doc/groonga/ja/html/reference/commands/table_rename.html +31 -31
- data/vendor/local/share/doc/groonga/ja/html/reference/commands/table_tokenize.html +39 -39
- data/vendor/local/share/doc/groonga/ja/html/reference/commands/thread_limit.html +31 -31
- data/vendor/local/share/doc/groonga/ja/html/reference/commands/tokenize.html +43 -43
- data/vendor/local/share/doc/groonga/ja/html/reference/commands/tokenizer_list.html +25 -25
- data/vendor/local/share/doc/groonga/ja/html/reference/commands/truncate.html +25 -25
- data/vendor/local/share/doc/groonga/ja/html/reference/executables.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/executables/grndb.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/executables/grnslap.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/executables/groonga-benchmark.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/executables/groonga-httpd.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/executables/groonga-server-http.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/executables/groonga-suggest-create-dataset.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/executables/groonga-suggest-httpd.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/executables/groonga-suggest-learner.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/executables/groonga.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/function.html +18 -17
- data/vendor/local/share/doc/groonga/ja/html/reference/functions/between.html +13 -7
- data/vendor/local/share/doc/groonga/ja/html/reference/functions/edit_distance.html +7 -7
- data/vendor/local/share/doc/groonga/ja/html/reference/functions/geo_distance.html +7 -7
- data/vendor/local/share/doc/groonga/ja/html/reference/functions/geo_in_circle.html +6 -6
- data/vendor/local/share/doc/groonga/ja/html/reference/functions/geo_in_rectangle.html +6 -6
- data/vendor/local/share/doc/groonga/ja/html/reference/functions/highlight_full.html +8 -8
- data/vendor/local/share/doc/groonga/ja/html/reference/functions/highlight_html.html +9 -9
- data/vendor/local/share/doc/groonga/ja/html/reference/functions/html_untag.html +9 -9
- data/vendor/local/share/doc/groonga/ja/html/reference/functions/in_values.html +8 -8
- data/vendor/local/share/doc/groonga/ja/html/reference/functions/now.html +11 -11
- data/vendor/local/share/doc/groonga/ja/html/reference/functions/prefix_rk_search.html +422 -0
- data/vendor/local/share/doc/groonga/ja/html/reference/functions/query.html +42 -42
- data/vendor/local/share/doc/groonga/ja/html/reference/functions/rand.html +27 -27
- data/vendor/local/share/doc/groonga/ja/html/reference/functions/snippet_html.html +27 -27
- data/vendor/local/share/doc/groonga/ja/html/reference/functions/sub_filter.html +31 -31
- data/vendor/local/share/doc/groonga/ja/html/reference/functions/vector_size.html +23 -23
- data/vendor/local/share/doc/groonga/ja/html/reference/grn_expr.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/grn_expr/query_syntax.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/grn_expr/script_syntax.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/indexing.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/log.html +9 -9
- data/vendor/local/share/doc/groonga/ja/html/reference/normalizers.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/operations.html +11 -13
- data/vendor/local/share/doc/groonga/ja/html/reference/operations/geolocation_search.html +10 -10
- data/vendor/local/share/doc/groonga/ja/html/reference/operations/prefix_rk_search.html +190 -0
- data/vendor/local/share/doc/groonga/ja/html/reference/output.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/query_expanders.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/query_expanders/tsv.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/regular_expression.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/scorer.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/scorers/scorer_tf_at_most.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/scorers/scorer_tf_idf.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/sharding.html +15 -15
- data/vendor/local/share/doc/groonga/ja/html/reference/suggest.html +10 -10
- data/vendor/local/share/doc/groonga/ja/html/reference/suggest/completion.html +6 -7
- data/vendor/local/share/doc/groonga/ja/html/reference/suggest/correction.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/suggest/introduction.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/suggest/suggestion.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/tables.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/token_filters.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/tokenizers.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/tuning.html +6 -6
- data/vendor/local/share/doc/groonga/ja/html/reference/types.html +9 -9
- data/vendor/local/share/doc/groonga/ja/html/search.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/searchindex.js +1 -1
- data/vendor/local/share/doc/groonga/ja/html/server.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/server/gqtp.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/server/http.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/server/http/comparison.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/server/http/groonga-httpd.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/server/http/groonga.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/server/memcached.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/server/package.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/spec.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/spec/gqtp.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/spec/search.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/troubleshooting.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/troubleshooting/different_results_with_the_same_keyword.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/troubleshooting/mmap_cannot_allocate_memory.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/tutorial.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/tutorial/data.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/tutorial/drilldown.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/tutorial/index.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/tutorial/introduction.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/tutorial/lexicon.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/tutorial/match_columns.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/tutorial/micro_blog.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/tutorial/network.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/tutorial/patricia_trie.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/tutorial/query_expansion.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/tutorial/search.html +5 -5
- data/vendor/local/share/groonga/html/admin/404.html +26 -2
- data/vendor/local/share/groonga/html/admin/bower_components/bootstrap-sass-official/assets/fonts/bootstrap/glyphicons-halflings-regular.eot +0 -0
- data/vendor/local/share/groonga/html/admin/bower_components/bootstrap-sass-official/assets/fonts/bootstrap/glyphicons-halflings-regular.svg +272 -213
- data/vendor/local/share/groonga/html/admin/bower_components/bootstrap-sass-official/assets/fonts/bootstrap/glyphicons-halflings-regular.ttf +0 -0
- data/vendor/local/share/groonga/html/admin/bower_components/bootstrap-sass-official/assets/fonts/bootstrap/glyphicons-halflings-regular.woff +0 -0
- data/vendor/local/share/groonga/html/admin/bower_components/bootstrap-sass-official/assets/fonts/bootstrap/glyphicons-halflings-regular.woff2 +0 -0
- data/vendor/local/share/groonga/html/admin/index.html +39 -5
- data/vendor/local/share/groonga/html/admin/scripts/oldieshim.572be7b4.js +2337 -0
- data/vendor/local/share/groonga/html/admin/scripts/scripts.a1c295fa.js +1749 -0
- data/vendor/local/share/groonga/html/admin/scripts/vendor.2c228d46.js +50748 -0
- data/vendor/local/share/groonga/html/admin/styles/main.d9de008c.css +12602 -0
- data/vendor/local/share/groonga/html/admin/styles/vendor.7f75f6e0.css +130 -0
- data/vendor/local/share/groonga/html/admin/views/columns/new.html +64 -1
- data/vendor/local/share/groonga/html/admin/views/columns/show.html +70 -1
- data/vendor/local/share/groonga/html/admin/views/tables/index.html +53 -1
- data/vendor/local/share/groonga/html/admin/views/tables/new.html +54 -2
- data/vendor/local/share/groonga/html/admin/views/tables/search.html +236 -1
- data/vendor/local/share/groonga/html/admin/views/tables/show.html +111 -1
- data/vendor/local/share/groonga/html/admin/views/top.html +20 -1
- data/vendor/local/share/license/groonga-admin/README.md +2 -2
- data/vendor/local/share/man/ja/man1/groonga.1 +955 -3334
- data/vendor/local/share/man/man1/groonga.1 +937 -3373
- metadata +78 -57
- data/vendor/local/share/groonga/html/admin/images/yeoman.d2754b85.png +0 -0
- data/vendor/local/share/groonga/html/admin/scripts/oldieshim.a466b7b1.js +0 -1
- data/vendor/local/share/groonga/html/admin/scripts/scripts.87083bfd.js +0 -1
- data/vendor/local/share/groonga/html/admin/scripts/vendor.fa48c0ac.js +0 -13
- data/vendor/local/share/groonga/html/admin/styles/main.0390285b.css +0 -1
- data/vendor/local/share/groonga/html/admin/styles/vendor.f4ae649a.css +0 -10
Binary file
|
Binary file
|
Binary file
|
@@ -1,9 +1,43 @@
|
|
1
|
-
<!DOCTYPE html>
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html class="no-js">
|
3
|
+
<head>
|
4
|
+
<meta charset="utf-8">
|
5
|
+
<title>Groonga Admin</title>
|
6
|
+
<meta name="description" content="">
|
7
|
+
<meta name="viewport" content="width=device-width">
|
8
|
+
<link rel="shortcut icon" href="favicon.ico">
|
9
|
+
<link rel="icon" href="favicon.png">
|
10
|
+
<!-- Place apple-touch-icon.png in the root directory -->
|
11
|
+
<link rel="stylesheet" href="styles/vendor.7f75f6e0.css">
|
12
|
+
<link rel="stylesheet" href="styles/main.d9de008c.css">
|
13
|
+
</head>
|
14
|
+
<body ng-app="groongaAdminApp">
|
15
|
+
<!--[if lt IE 7]>
|
2
16
|
<p class="browsehappy">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p>
|
3
|
-
<![endif]-->
|
17
|
+
<![endif]-->
|
18
|
+
|
19
|
+
<div class="navbar" role="navigation">
|
20
|
+
<div class="container-fuild">
|
21
|
+
<div class="navbar-header">
|
22
|
+
<a class="navbar-brand" href="#/">Groonga Admin</a>
|
23
|
+
</div>
|
24
|
+
<!--div class="collapse navbar-collapse">
|
4
25
|
<ul class="nav navbar-nav">
|
5
26
|
<li><a href="/document/">Document</a></li>
|
6
27
|
</ul>
|
7
|
-
</div-->
|
8
|
-
|
9
|
-
|
28
|
+
</div-->
|
29
|
+
</div>
|
30
|
+
</div>
|
31
|
+
|
32
|
+
<div ng-view=""></div>
|
33
|
+
|
34
|
+
|
35
|
+
<!--[if lt IE 9]>
|
36
|
+
<script src="scripts/oldieshim.572be7b4.js"></script>
|
37
|
+
<![endif]-->
|
38
|
+
|
39
|
+
<script src="scripts/vendor.2c228d46.js"></script>
|
40
|
+
|
41
|
+
<script src="scripts/scripts.a1c295fa.js"></script>
|
42
|
+
</body>
|
43
|
+
</html>
|
@@ -0,0 +1,2337 @@
|
|
1
|
+
/*!
|
2
|
+
* https://github.com/es-shims/es5-shim
|
3
|
+
* @license es5-shim Copyright 2009-2014 by contributors, MIT License
|
4
|
+
* see https://github.com/es-shims/es5-shim/blob/master/LICENSE
|
5
|
+
*/
|
6
|
+
|
7
|
+
// vim: ts=4 sts=4 sw=4 expandtab
|
8
|
+
|
9
|
+
//Add semicolon to prevent IIFE from being passed as argument to concated code.
|
10
|
+
;
|
11
|
+
|
12
|
+
// UMD (Universal Module Definition)
|
13
|
+
// see https://github.com/umdjs/umd/blob/master/returnExports.js
|
14
|
+
(function (root, factory) {
|
15
|
+
if (typeof define === 'function' && define.amd) {
|
16
|
+
// AMD. Register as an anonymous module.
|
17
|
+
define(factory);
|
18
|
+
} else if (typeof exports === 'object') {
|
19
|
+
// Node. Does not work with strict CommonJS, but
|
20
|
+
// only CommonJS-like enviroments that support module.exports,
|
21
|
+
// like Node.
|
22
|
+
module.exports = factory();
|
23
|
+
} else {
|
24
|
+
// Browser globals (root is window)
|
25
|
+
root.returnExports = factory();
|
26
|
+
}
|
27
|
+
}(this, function () {
|
28
|
+
|
29
|
+
/**
|
30
|
+
* Brings an environment as close to ECMAScript 5 compliance
|
31
|
+
* as is possible with the facilities of erstwhile engines.
|
32
|
+
*
|
33
|
+
* Annotated ES5: http://es5.github.com/ (specific links below)
|
34
|
+
* ES5 Spec: http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-262.pdf
|
35
|
+
* Required reading: http://javascriptweblog.wordpress.com/2011/12/05/extending-javascript-natives/
|
36
|
+
*/
|
37
|
+
|
38
|
+
// Shortcut to an often accessed properties, in order to avoid multiple
|
39
|
+
// dereference that costs universally.
|
40
|
+
var call = Function.prototype.call;
|
41
|
+
var prototypeOfArray = Array.prototype;
|
42
|
+
var prototypeOfObject = Object.prototype;
|
43
|
+
var _Array_slice_ = prototypeOfArray.slice;
|
44
|
+
var array_splice = Array.prototype.splice;
|
45
|
+
var array_push = Array.prototype.push;
|
46
|
+
var array_unshift = Array.prototype.unshift;
|
47
|
+
|
48
|
+
var isFunction = function (val) {
|
49
|
+
return prototypeOfObject.toString.call(val) === '[object Function]';
|
50
|
+
};
|
51
|
+
var isRegex = function (val) {
|
52
|
+
return prototypeOfObject.toString.call(val) === '[object RegExp]';
|
53
|
+
};
|
54
|
+
|
55
|
+
//
|
56
|
+
// Function
|
57
|
+
// ========
|
58
|
+
//
|
59
|
+
|
60
|
+
// ES-5 15.3.4.5
|
61
|
+
// http://es5.github.com/#x15.3.4.5
|
62
|
+
|
63
|
+
function Empty() {}
|
64
|
+
|
65
|
+
if (!Function.prototype.bind) {
|
66
|
+
Function.prototype.bind = function bind(that) { // .length is 1
|
67
|
+
// 1. Let Target be the this value.
|
68
|
+
var target = this;
|
69
|
+
// 2. If IsCallable(Target) is false, throw a TypeError exception.
|
70
|
+
if (!isFunction(target)) {
|
71
|
+
throw new TypeError("Function.prototype.bind called on incompatible " + target);
|
72
|
+
}
|
73
|
+
// 3. Let A be a new (possibly empty) internal list of all of the
|
74
|
+
// argument values provided after thisArg (arg1, arg2 etc), in order.
|
75
|
+
// XXX slicedArgs will stand in for "A" if used
|
76
|
+
var args = _Array_slice_.call(arguments, 1); // for normal call
|
77
|
+
// 4. Let F be a new native ECMAScript object.
|
78
|
+
// 11. Set the [[Prototype]] internal property of F to the standard
|
79
|
+
// built-in Function prototype object as specified in 15.3.3.1.
|
80
|
+
// 12. Set the [[Call]] internal property of F as described in
|
81
|
+
// 15.3.4.5.1.
|
82
|
+
// 13. Set the [[Construct]] internal property of F as described in
|
83
|
+
// 15.3.4.5.2.
|
84
|
+
// 14. Set the [[HasInstance]] internal property of F as described in
|
85
|
+
// 15.3.4.5.3.
|
86
|
+
var binder = function () {
|
87
|
+
|
88
|
+
if (this instanceof bound) {
|
89
|
+
// 15.3.4.5.2 [[Construct]]
|
90
|
+
// When the [[Construct]] internal method of a function object,
|
91
|
+
// F that was created using the bind function is called with a
|
92
|
+
// list of arguments ExtraArgs, the following steps are taken:
|
93
|
+
// 1. Let target be the value of F's [[TargetFunction]]
|
94
|
+
// internal property.
|
95
|
+
// 2. If target has no [[Construct]] internal method, a
|
96
|
+
// TypeError exception is thrown.
|
97
|
+
// 3. Let boundArgs be the value of F's [[BoundArgs]] internal
|
98
|
+
// property.
|
99
|
+
// 4. Let args be a new list containing the same values as the
|
100
|
+
// list boundArgs in the same order followed by the same
|
101
|
+
// values as the list ExtraArgs in the same order.
|
102
|
+
// 5. Return the result of calling the [[Construct]] internal
|
103
|
+
// method of target providing args as the arguments.
|
104
|
+
|
105
|
+
var result = target.apply(
|
106
|
+
this,
|
107
|
+
args.concat(_Array_slice_.call(arguments))
|
108
|
+
);
|
109
|
+
if (Object(result) === result) {
|
110
|
+
return result;
|
111
|
+
}
|
112
|
+
return this;
|
113
|
+
|
114
|
+
} else {
|
115
|
+
// 15.3.4.5.1 [[Call]]
|
116
|
+
// When the [[Call]] internal method of a function object, F,
|
117
|
+
// which was created using the bind function is called with a
|
118
|
+
// this value and a list of arguments ExtraArgs, the following
|
119
|
+
// steps are taken:
|
120
|
+
// 1. Let boundArgs be the value of F's [[BoundArgs]] internal
|
121
|
+
// property.
|
122
|
+
// 2. Let boundThis be the value of F's [[BoundThis]] internal
|
123
|
+
// property.
|
124
|
+
// 3. Let target be the value of F's [[TargetFunction]] internal
|
125
|
+
// property.
|
126
|
+
// 4. Let args be a new list containing the same values as the
|
127
|
+
// list boundArgs in the same order followed by the same
|
128
|
+
// values as the list ExtraArgs in the same order.
|
129
|
+
// 5. Return the result of calling the [[Call]] internal method
|
130
|
+
// of target providing boundThis as the this value and
|
131
|
+
// providing args as the arguments.
|
132
|
+
|
133
|
+
// equiv: target.call(this, ...boundArgs, ...args)
|
134
|
+
return target.apply(
|
135
|
+
that,
|
136
|
+
args.concat(_Array_slice_.call(arguments))
|
137
|
+
);
|
138
|
+
|
139
|
+
}
|
140
|
+
|
141
|
+
};
|
142
|
+
|
143
|
+
// 15. If the [[Class]] internal property of Target is "Function", then
|
144
|
+
// a. Let L be the length property of Target minus the length of A.
|
145
|
+
// b. Set the length own property of F to either 0 or L, whichever is
|
146
|
+
// larger.
|
147
|
+
// 16. Else set the length own property of F to 0.
|
148
|
+
|
149
|
+
var boundLength = Math.max(0, target.length - args.length);
|
150
|
+
|
151
|
+
// 17. Set the attributes of the length own property of F to the values
|
152
|
+
// specified in 15.3.5.1.
|
153
|
+
var boundArgs = [];
|
154
|
+
for (var i = 0; i < boundLength; i++) {
|
155
|
+
boundArgs.push("$" + i);
|
156
|
+
}
|
157
|
+
|
158
|
+
// XXX Build a dynamic function with desired amount of arguments is the only
|
159
|
+
// way to set the length property of a function.
|
160
|
+
// In environments where Content Security Policies enabled (Chrome extensions,
|
161
|
+
// for ex.) all use of eval or Function costructor throws an exception.
|
162
|
+
// However in all of these environments Function.prototype.bind exists
|
163
|
+
// and so this code will never be executed.
|
164
|
+
var bound = Function("binder", "return function(" + boundArgs.join(",") + "){return binder.apply(this,arguments)}")(binder);
|
165
|
+
|
166
|
+
if (target.prototype) {
|
167
|
+
Empty.prototype = target.prototype;
|
168
|
+
bound.prototype = new Empty();
|
169
|
+
// Clean up dangling references.
|
170
|
+
Empty.prototype = null;
|
171
|
+
}
|
172
|
+
|
173
|
+
// TODO
|
174
|
+
// 18. Set the [[Extensible]] internal property of F to true.
|
175
|
+
|
176
|
+
// TODO
|
177
|
+
// 19. Let thrower be the [[ThrowTypeError]] function Object (13.2.3).
|
178
|
+
// 20. Call the [[DefineOwnProperty]] internal method of F with
|
179
|
+
// arguments "caller", PropertyDescriptor {[[Get]]: thrower, [[Set]]:
|
180
|
+
// thrower, [[Enumerable]]: false, [[Configurable]]: false}, and
|
181
|
+
// false.
|
182
|
+
// 21. Call the [[DefineOwnProperty]] internal method of F with
|
183
|
+
// arguments "arguments", PropertyDescriptor {[[Get]]: thrower,
|
184
|
+
// [[Set]]: thrower, [[Enumerable]]: false, [[Configurable]]: false},
|
185
|
+
// and false.
|
186
|
+
|
187
|
+
// TODO
|
188
|
+
// NOTE Function objects created using Function.prototype.bind do not
|
189
|
+
// have a prototype property or the [[Code]], [[FormalParameters]], and
|
190
|
+
// [[Scope]] internal properties.
|
191
|
+
// XXX can't delete prototype in pure-js.
|
192
|
+
|
193
|
+
// 22. Return F.
|
194
|
+
return bound;
|
195
|
+
};
|
196
|
+
}
|
197
|
+
|
198
|
+
// _Please note: Shortcuts are defined after `Function.prototype.bind` as we
|
199
|
+
// us it in defining shortcuts.
|
200
|
+
var owns = call.bind(prototypeOfObject.hasOwnProperty);
|
201
|
+
// Having a toString local variable name breaks in Opera so use _toString.
|
202
|
+
var _toString = call.bind(prototypeOfObject.toString);
|
203
|
+
|
204
|
+
// If JS engine supports accessors creating shortcuts.
|
205
|
+
var defineGetter;
|
206
|
+
var defineSetter;
|
207
|
+
var lookupGetter;
|
208
|
+
var lookupSetter;
|
209
|
+
var supportsAccessors;
|
210
|
+
if ((supportsAccessors = owns(prototypeOfObject, "__defineGetter__"))) {
|
211
|
+
defineGetter = call.bind(prototypeOfObject.__defineGetter__);
|
212
|
+
defineSetter = call.bind(prototypeOfObject.__defineSetter__);
|
213
|
+
lookupGetter = call.bind(prototypeOfObject.__lookupGetter__);
|
214
|
+
lookupSetter = call.bind(prototypeOfObject.__lookupSetter__);
|
215
|
+
}
|
216
|
+
|
217
|
+
//
|
218
|
+
// Array
|
219
|
+
// =====
|
220
|
+
//
|
221
|
+
|
222
|
+
// ES5 15.4.4.12
|
223
|
+
// http://es5.github.com/#x15.4.4.12
|
224
|
+
// Default value for second param
|
225
|
+
// [bugfix, ielt9, old browsers]
|
226
|
+
// IE < 9 bug: [1,2].splice(0).join("") === "" but should be "12"
|
227
|
+
if ([1, 2].splice(0).length !== 2) {
|
228
|
+
if (function () { // test IE < 9 to splice bug - see issue #138
|
229
|
+
function makeArray(l) {
|
230
|
+
var a = [];
|
231
|
+
while (l--) {
|
232
|
+
a.unshift(l);
|
233
|
+
}
|
234
|
+
return a;
|
235
|
+
}
|
236
|
+
|
237
|
+
var array = [];
|
238
|
+
var lengthBefore;
|
239
|
+
|
240
|
+
array.splice.bind(array, 0, 0).apply(null, makeArray(20));
|
241
|
+
array.splice.bind(array, 0, 0).apply(null, makeArray(26));
|
242
|
+
|
243
|
+
lengthBefore = array.length; //20
|
244
|
+
array.splice(5, 0, "XXX"); // add one element
|
245
|
+
|
246
|
+
if (lengthBefore + 1 === array.length) {
|
247
|
+
return true;// has right splice implementation without bugs
|
248
|
+
}
|
249
|
+
// else {
|
250
|
+
// IE8 bug
|
251
|
+
// }
|
252
|
+
}()) { // IE 6/7
|
253
|
+
Array.prototype.splice = function(start, deleteCount) {
|
254
|
+
if (!arguments.length) {
|
255
|
+
return [];
|
256
|
+
} else {
|
257
|
+
return array_splice.apply(this, [
|
258
|
+
start === void 0 ? 0 : start,
|
259
|
+
deleteCount === void 0 ? (this.length - start) : deleteCount
|
260
|
+
].concat(_Array_slice_.call(arguments, 2)));
|
261
|
+
}
|
262
|
+
};
|
263
|
+
} else { // IE8
|
264
|
+
Array.prototype.splice = function(start, deleteCount) {
|
265
|
+
var result;
|
266
|
+
var args = _Array_slice_.call(arguments, 2);
|
267
|
+
var addElementsCount = args.length;
|
268
|
+
|
269
|
+
if (!arguments.length) {
|
270
|
+
return [];
|
271
|
+
}
|
272
|
+
|
273
|
+
if (start === void 0) { // default
|
274
|
+
start = 0;
|
275
|
+
}
|
276
|
+
if (deleteCount === void 0) { // default
|
277
|
+
deleteCount = this.length - start;
|
278
|
+
}
|
279
|
+
|
280
|
+
if (addElementsCount > 0) {
|
281
|
+
if (deleteCount <= 0) {
|
282
|
+
if (start === this.length) { // tiny optimisation #1
|
283
|
+
array_push.apply(this, args);
|
284
|
+
return [];
|
285
|
+
}
|
286
|
+
|
287
|
+
if (start === 0) { // tiny optimisation #2
|
288
|
+
array_unshift.apply(this, args);
|
289
|
+
return [];
|
290
|
+
}
|
291
|
+
}
|
292
|
+
|
293
|
+
// Array.prototype.splice implementation
|
294
|
+
result = _Array_slice_.call(this, start, start + deleteCount);// delete part
|
295
|
+
args.push.apply(args, _Array_slice_.call(this, start + deleteCount, this.length));// right part
|
296
|
+
args.unshift.apply(args, _Array_slice_.call(this, 0, start));// left part
|
297
|
+
|
298
|
+
// delete all items from this array and replace it to 'left part' + _Array_slice_.call(arguments, 2) + 'right part'
|
299
|
+
args.unshift(0, this.length);
|
300
|
+
|
301
|
+
array_splice.apply(this, args);
|
302
|
+
|
303
|
+
return result;
|
304
|
+
}
|
305
|
+
|
306
|
+
return array_splice.call(this, start, deleteCount);
|
307
|
+
};
|
308
|
+
|
309
|
+
}
|
310
|
+
}
|
311
|
+
|
312
|
+
// ES5 15.4.4.12
|
313
|
+
// http://es5.github.com/#x15.4.4.13
|
314
|
+
// Return len+argCount.
|
315
|
+
// [bugfix, ielt8]
|
316
|
+
// IE < 8 bug: [].unshift(0) === undefined but should be "1"
|
317
|
+
if ([].unshift(0) !== 1) {
|
318
|
+
Array.prototype.unshift = function() {
|
319
|
+
array_unshift.apply(this, arguments);
|
320
|
+
return this.length;
|
321
|
+
};
|
322
|
+
}
|
323
|
+
|
324
|
+
// ES5 15.4.3.2
|
325
|
+
// http://es5.github.com/#x15.4.3.2
|
326
|
+
// https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/isArray
|
327
|
+
if (!Array.isArray) {
|
328
|
+
Array.isArray = function isArray(obj) {
|
329
|
+
return _toString(obj) === "[object Array]";
|
330
|
+
};
|
331
|
+
}
|
332
|
+
|
333
|
+
// The IsCallable() check in the Array functions
|
334
|
+
// has been replaced with a strict check on the
|
335
|
+
// internal class of the object to trap cases where
|
336
|
+
// the provided function was actually a regular
|
337
|
+
// expression literal, which in V8 and
|
338
|
+
// JavaScriptCore is a typeof "function". Only in
|
339
|
+
// V8 are regular expression literals permitted as
|
340
|
+
// reduce parameters, so it is desirable in the
|
341
|
+
// general case for the shim to match the more
|
342
|
+
// strict and common behavior of rejecting regular
|
343
|
+
// expressions.
|
344
|
+
|
345
|
+
// ES5 15.4.4.18
|
346
|
+
// http://es5.github.com/#x15.4.4.18
|
347
|
+
// https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/array/forEach
|
348
|
+
|
349
|
+
|
350
|
+
// Check failure of by-index access of string characters (IE < 9)
|
351
|
+
// and failure of `0 in boxedString` (Rhino)
|
352
|
+
var boxedString = Object("a");
|
353
|
+
var splitString = boxedString[0] !== "a" || !(0 in boxedString);
|
354
|
+
|
355
|
+
var properlyBoxesContext = function properlyBoxed(method) {
|
356
|
+
// Check node 0.6.21 bug where third parameter is not boxed
|
357
|
+
var properlyBoxes = true;
|
358
|
+
if (method) {
|
359
|
+
method.call('foo', function (_, __, context) {
|
360
|
+
if (typeof context !== 'object') { properlyBoxes = false; }
|
361
|
+
});
|
362
|
+
}
|
363
|
+
return !!method && properlyBoxes;
|
364
|
+
};
|
365
|
+
|
366
|
+
if (!Array.prototype.forEach || !properlyBoxesContext(Array.prototype.forEach)) {
|
367
|
+
Array.prototype.forEach = function forEach(fun /*, thisp*/) {
|
368
|
+
var object = toObject(this),
|
369
|
+
self = splitString && _toString(this) === "[object String]" ?
|
370
|
+
this.split("") :
|
371
|
+
object,
|
372
|
+
thisp = arguments[1],
|
373
|
+
i = -1,
|
374
|
+
length = self.length >>> 0;
|
375
|
+
|
376
|
+
// If no callback function or if callback is not a callable function
|
377
|
+
if (!isFunction(fun)) {
|
378
|
+
throw new TypeError(); // TODO message
|
379
|
+
}
|
380
|
+
|
381
|
+
while (++i < length) {
|
382
|
+
if (i in self) {
|
383
|
+
// Invoke the callback function with call, passing arguments:
|
384
|
+
// context, property value, property key, thisArg object
|
385
|
+
// context
|
386
|
+
fun.call(thisp, self[i], i, object);
|
387
|
+
}
|
388
|
+
}
|
389
|
+
};
|
390
|
+
}
|
391
|
+
|
392
|
+
// ES5 15.4.4.19
|
393
|
+
// http://es5.github.com/#x15.4.4.19
|
394
|
+
// https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Objects/Array/map
|
395
|
+
if (!Array.prototype.map || !properlyBoxesContext(Array.prototype.map)) {
|
396
|
+
Array.prototype.map = function map(fun /*, thisp*/) {
|
397
|
+
var object = toObject(this),
|
398
|
+
self = splitString && _toString(this) === "[object String]" ?
|
399
|
+
this.split("") :
|
400
|
+
object,
|
401
|
+
length = self.length >>> 0,
|
402
|
+
result = Array(length),
|
403
|
+
thisp = arguments[1];
|
404
|
+
|
405
|
+
// If no callback function or if callback is not a callable function
|
406
|
+
if (!isFunction(fun)) {
|
407
|
+
throw new TypeError(fun + " is not a function");
|
408
|
+
}
|
409
|
+
|
410
|
+
for (var i = 0; i < length; i++) {
|
411
|
+
if (i in self)
|
412
|
+
result[i] = fun.call(thisp, self[i], i, object);
|
413
|
+
}
|
414
|
+
return result;
|
415
|
+
};
|
416
|
+
}
|
417
|
+
|
418
|
+
// ES5 15.4.4.20
|
419
|
+
// http://es5.github.com/#x15.4.4.20
|
420
|
+
// https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Objects/Array/filter
|
421
|
+
if (!Array.prototype.filter || !properlyBoxesContext(Array.prototype.filter)) {
|
422
|
+
Array.prototype.filter = function filter(fun /*, thisp */) {
|
423
|
+
var object = toObject(this),
|
424
|
+
self = splitString && _toString(this) === "[object String]" ?
|
425
|
+
this.split("") :
|
426
|
+
object,
|
427
|
+
length = self.length >>> 0,
|
428
|
+
result = [],
|
429
|
+
value,
|
430
|
+
thisp = arguments[1];
|
431
|
+
|
432
|
+
// If no callback function or if callback is not a callable function
|
433
|
+
if (!isFunction(fun)) {
|
434
|
+
throw new TypeError(fun + " is not a function");
|
435
|
+
}
|
436
|
+
|
437
|
+
for (var i = 0; i < length; i++) {
|
438
|
+
if (i in self) {
|
439
|
+
value = self[i];
|
440
|
+
if (fun.call(thisp, value, i, object)) {
|
441
|
+
result.push(value);
|
442
|
+
}
|
443
|
+
}
|
444
|
+
}
|
445
|
+
return result;
|
446
|
+
};
|
447
|
+
}
|
448
|
+
|
449
|
+
// ES5 15.4.4.16
|
450
|
+
// http://es5.github.com/#x15.4.4.16
|
451
|
+
// https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/every
|
452
|
+
if (!Array.prototype.every || !properlyBoxesContext(Array.prototype.every)) {
|
453
|
+
Array.prototype.every = function every(fun /*, thisp */) {
|
454
|
+
var object = toObject(this),
|
455
|
+
self = splitString && _toString(this) === "[object String]" ?
|
456
|
+
this.split("") :
|
457
|
+
object,
|
458
|
+
length = self.length >>> 0,
|
459
|
+
thisp = arguments[1];
|
460
|
+
|
461
|
+
// If no callback function or if callback is not a callable function
|
462
|
+
if (!isFunction(fun)) {
|
463
|
+
throw new TypeError(fun + " is not a function");
|
464
|
+
}
|
465
|
+
|
466
|
+
for (var i = 0; i < length; i++) {
|
467
|
+
if (i in self && !fun.call(thisp, self[i], i, object)) {
|
468
|
+
return false;
|
469
|
+
}
|
470
|
+
}
|
471
|
+
return true;
|
472
|
+
};
|
473
|
+
}
|
474
|
+
|
475
|
+
// ES5 15.4.4.17
|
476
|
+
// http://es5.github.com/#x15.4.4.17
|
477
|
+
// https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/some
|
478
|
+
if (!Array.prototype.some || !properlyBoxesContext(Array.prototype.some)) {
|
479
|
+
Array.prototype.some = function some(fun /*, thisp */) {
|
480
|
+
var object = toObject(this),
|
481
|
+
self = splitString && _toString(this) === "[object String]" ?
|
482
|
+
this.split("") :
|
483
|
+
object,
|
484
|
+
length = self.length >>> 0,
|
485
|
+
thisp = arguments[1];
|
486
|
+
|
487
|
+
// If no callback function or if callback is not a callable function
|
488
|
+
if (!isFunction(fun)) {
|
489
|
+
throw new TypeError(fun + " is not a function");
|
490
|
+
}
|
491
|
+
|
492
|
+
for (var i = 0; i < length; i++) {
|
493
|
+
if (i in self && fun.call(thisp, self[i], i, object)) {
|
494
|
+
return true;
|
495
|
+
}
|
496
|
+
}
|
497
|
+
return false;
|
498
|
+
};
|
499
|
+
}
|
500
|
+
|
501
|
+
// ES5 15.4.4.21
|
502
|
+
// http://es5.github.com/#x15.4.4.21
|
503
|
+
// https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Objects/Array/reduce
|
504
|
+
var reduceCoercesToObject = false;
|
505
|
+
if (Array.prototype.reduce) {
|
506
|
+
reduceCoercesToObject = typeof Array.prototype.reduce.call('a', function (_, __, ___, list) { return list; }) === 'object';
|
507
|
+
}
|
508
|
+
if (!Array.prototype.reduce || !reduceCoercesToObject) {
|
509
|
+
Array.prototype.reduce = function reduce(fun /*, initial*/) {
|
510
|
+
var object = toObject(this),
|
511
|
+
self = splitString && _toString(this) === "[object String]" ?
|
512
|
+
this.split("") :
|
513
|
+
object,
|
514
|
+
length = self.length >>> 0;
|
515
|
+
|
516
|
+
// If no callback function or if callback is not a callable function
|
517
|
+
if (!isFunction(fun)) {
|
518
|
+
throw new TypeError(fun + " is not a function");
|
519
|
+
}
|
520
|
+
|
521
|
+
// no value to return if no initial value and an empty array
|
522
|
+
if (!length && arguments.length === 1) {
|
523
|
+
throw new TypeError("reduce of empty array with no initial value");
|
524
|
+
}
|
525
|
+
|
526
|
+
var i = 0;
|
527
|
+
var result;
|
528
|
+
if (arguments.length >= 2) {
|
529
|
+
result = arguments[1];
|
530
|
+
} else {
|
531
|
+
do {
|
532
|
+
if (i in self) {
|
533
|
+
result = self[i++];
|
534
|
+
break;
|
535
|
+
}
|
536
|
+
|
537
|
+
// if array contains no values, no initial value to return
|
538
|
+
if (++i >= length) {
|
539
|
+
throw new TypeError("reduce of empty array with no initial value");
|
540
|
+
}
|
541
|
+
} while (true);
|
542
|
+
}
|
543
|
+
|
544
|
+
for (; i < length; i++) {
|
545
|
+
if (i in self) {
|
546
|
+
result = fun.call(void 0, result, self[i], i, object);
|
547
|
+
}
|
548
|
+
}
|
549
|
+
|
550
|
+
return result;
|
551
|
+
};
|
552
|
+
}
|
553
|
+
|
554
|
+
// ES5 15.4.4.22
|
555
|
+
// http://es5.github.com/#x15.4.4.22
|
556
|
+
// https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Objects/Array/reduceRight
|
557
|
+
if (!Array.prototype.reduceRight) {
|
558
|
+
Array.prototype.reduceRight = function reduceRight(fun /*, initial*/) {
|
559
|
+
var object = toObject(this),
|
560
|
+
self = splitString && _toString(this) === "[object String]" ?
|
561
|
+
this.split("") :
|
562
|
+
object,
|
563
|
+
length = self.length >>> 0;
|
564
|
+
|
565
|
+
// If no callback function or if callback is not a callable function
|
566
|
+
if (!isFunction(fun)) {
|
567
|
+
throw new TypeError(fun + " is not a function");
|
568
|
+
}
|
569
|
+
|
570
|
+
// no value to return if no initial value, empty array
|
571
|
+
if (!length && arguments.length === 1) {
|
572
|
+
throw new TypeError("reduceRight of empty array with no initial value");
|
573
|
+
}
|
574
|
+
|
575
|
+
var result, i = length - 1;
|
576
|
+
if (arguments.length >= 2) {
|
577
|
+
result = arguments[1];
|
578
|
+
} else {
|
579
|
+
do {
|
580
|
+
if (i in self) {
|
581
|
+
result = self[i--];
|
582
|
+
break;
|
583
|
+
}
|
584
|
+
|
585
|
+
// if array contains no values, no initial value to return
|
586
|
+
if (--i < 0) {
|
587
|
+
throw new TypeError("reduceRight of empty array with no initial value");
|
588
|
+
}
|
589
|
+
} while (true);
|
590
|
+
}
|
591
|
+
|
592
|
+
if (i < 0) {
|
593
|
+
return result;
|
594
|
+
}
|
595
|
+
|
596
|
+
do {
|
597
|
+
if (i in this) {
|
598
|
+
result = fun.call(void 0, result, self[i], i, object);
|
599
|
+
}
|
600
|
+
} while (i--);
|
601
|
+
|
602
|
+
return result;
|
603
|
+
};
|
604
|
+
}
|
605
|
+
|
606
|
+
// ES5 15.4.4.14
|
607
|
+
// http://es5.github.com/#x15.4.4.14
|
608
|
+
// https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/indexOf
|
609
|
+
if (!Array.prototype.indexOf || ([0, 1].indexOf(1, 2) !== -1)) {
|
610
|
+
Array.prototype.indexOf = function indexOf(sought /*, fromIndex */ ) {
|
611
|
+
var self = splitString && _toString(this) === "[object String]" ?
|
612
|
+
this.split("") :
|
613
|
+
toObject(this),
|
614
|
+
length = self.length >>> 0;
|
615
|
+
|
616
|
+
if (!length) {
|
617
|
+
return -1;
|
618
|
+
}
|
619
|
+
|
620
|
+
var i = 0;
|
621
|
+
if (arguments.length > 1) {
|
622
|
+
i = toInteger(arguments[1]);
|
623
|
+
}
|
624
|
+
|
625
|
+
// handle negative indices
|
626
|
+
i = i >= 0 ? i : Math.max(0, length + i);
|
627
|
+
for (; i < length; i++) {
|
628
|
+
if (i in self && self[i] === sought) {
|
629
|
+
return i;
|
630
|
+
}
|
631
|
+
}
|
632
|
+
return -1;
|
633
|
+
};
|
634
|
+
}
|
635
|
+
|
636
|
+
// ES5 15.4.4.15
|
637
|
+
// http://es5.github.com/#x15.4.4.15
|
638
|
+
// https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/lastIndexOf
|
639
|
+
if (!Array.prototype.lastIndexOf || ([0, 1].lastIndexOf(0, -3) !== -1)) {
|
640
|
+
Array.prototype.lastIndexOf = function lastIndexOf(sought /*, fromIndex */) {
|
641
|
+
var self = splitString && _toString(this) === "[object String]" ?
|
642
|
+
this.split("") :
|
643
|
+
toObject(this),
|
644
|
+
length = self.length >>> 0;
|
645
|
+
|
646
|
+
if (!length) {
|
647
|
+
return -1;
|
648
|
+
}
|
649
|
+
var i = length - 1;
|
650
|
+
if (arguments.length > 1) {
|
651
|
+
i = Math.min(i, toInteger(arguments[1]));
|
652
|
+
}
|
653
|
+
// handle negative indices
|
654
|
+
i = i >= 0 ? i : length - Math.abs(i);
|
655
|
+
for (; i >= 0; i--) {
|
656
|
+
if (i in self && sought === self[i]) {
|
657
|
+
return i;
|
658
|
+
}
|
659
|
+
}
|
660
|
+
return -1;
|
661
|
+
};
|
662
|
+
}
|
663
|
+
|
664
|
+
//
|
665
|
+
// Object
|
666
|
+
// ======
|
667
|
+
//
|
668
|
+
|
669
|
+
// ES5 15.2.3.14
|
670
|
+
// http://es5.github.com/#x15.2.3.14
|
671
|
+
if (!Object.keys) {
|
672
|
+
// http://whattheheadsaid.com/2010/10/a-safer-object-keys-compatibility-implementation
|
673
|
+
var hasDontEnumBug = !({'toString': null}).propertyIsEnumerable('toString'),
|
674
|
+
hasProtoEnumBug = (function () {}).propertyIsEnumerable('prototype'),
|
675
|
+
dontEnums = [
|
676
|
+
"toString",
|
677
|
+
"toLocaleString",
|
678
|
+
"valueOf",
|
679
|
+
"hasOwnProperty",
|
680
|
+
"isPrototypeOf",
|
681
|
+
"propertyIsEnumerable",
|
682
|
+
"constructor"
|
683
|
+
],
|
684
|
+
dontEnumsLength = dontEnums.length,
|
685
|
+
isArguments = function isArguments(value) {
|
686
|
+
var str = _toString(value);
|
687
|
+
var isArgs = str === '[object Arguments]';
|
688
|
+
if (!isArgs) {
|
689
|
+
isArgs = !Array.isArray(str)
|
690
|
+
&& value !== null
|
691
|
+
&& typeof value === 'object'
|
692
|
+
&& typeof value.length === 'number'
|
693
|
+
&& value.length >= 0
|
694
|
+
&& isFunction(value.callee);
|
695
|
+
}
|
696
|
+
return isArgs;
|
697
|
+
};
|
698
|
+
|
699
|
+
Object.keys = function keys(object) {
|
700
|
+
var isFn = isFunction(object),
|
701
|
+
isArgs = isArguments(object),
|
702
|
+
isObject = object !== null && typeof object === 'object',
|
703
|
+
isString = isObject && _toString(object) === '[object String]';
|
704
|
+
|
705
|
+
if (!isObject && !isFn && !isArgs) {
|
706
|
+
throw new TypeError("Object.keys called on a non-object");
|
707
|
+
}
|
708
|
+
|
709
|
+
var theKeys = [];
|
710
|
+
var skipProto = hasProtoEnumBug && isFn;
|
711
|
+
if (isString || isArgs) {
|
712
|
+
for (var i = 0; i < object.length; ++i) {
|
713
|
+
theKeys.push(String(i));
|
714
|
+
}
|
715
|
+
} else {
|
716
|
+
for (var name in object) {
|
717
|
+
if (!(skipProto && name === 'prototype') && owns(object, name)) {
|
718
|
+
theKeys.push(String(name));
|
719
|
+
}
|
720
|
+
}
|
721
|
+
}
|
722
|
+
|
723
|
+
if (hasDontEnumBug) {
|
724
|
+
var ctor = object.constructor,
|
725
|
+
skipConstructor = ctor && ctor.prototype === object;
|
726
|
+
for (var j = 0; j < dontEnumsLength; j++) {
|
727
|
+
var dontEnum = dontEnums[j];
|
728
|
+
if (!(skipConstructor && dontEnum === 'constructor') && owns(object, dontEnum)) {
|
729
|
+
theKeys.push(dontEnum);
|
730
|
+
}
|
731
|
+
}
|
732
|
+
}
|
733
|
+
return theKeys;
|
734
|
+
};
|
735
|
+
|
736
|
+
}
|
737
|
+
|
738
|
+
//
|
739
|
+
// Date
|
740
|
+
// ====
|
741
|
+
//
|
742
|
+
|
743
|
+
// ES5 15.9.5.43
|
744
|
+
// http://es5.github.com/#x15.9.5.43
|
745
|
+
// This function returns a String value represent the instance in time
|
746
|
+
// represented by this Date object. The format of the String is the Date Time
|
747
|
+
// string format defined in 15.9.1.15. All fields are present in the String.
|
748
|
+
// The time zone is always UTC, denoted by the suffix Z. If the time value of
|
749
|
+
// this object is not a finite Number a RangeError exception is thrown.
|
750
|
+
var negativeDate = -62198755200000,
|
751
|
+
negativeYearString = "-000001";
|
752
|
+
if (
|
753
|
+
!Date.prototype.toISOString ||
|
754
|
+
(new Date(negativeDate).toISOString().indexOf(negativeYearString) === -1)
|
755
|
+
) {
|
756
|
+
Date.prototype.toISOString = function toISOString() {
|
757
|
+
var result, length, value, year, month;
|
758
|
+
if (!isFinite(this)) {
|
759
|
+
throw new RangeError("Date.prototype.toISOString called on non-finite value.");
|
760
|
+
}
|
761
|
+
|
762
|
+
year = this.getUTCFullYear();
|
763
|
+
|
764
|
+
month = this.getUTCMonth();
|
765
|
+
// see https://github.com/es-shims/es5-shim/issues/111
|
766
|
+
year += Math.floor(month / 12);
|
767
|
+
month = (month % 12 + 12) % 12;
|
768
|
+
|
769
|
+
// the date time string format is specified in 15.9.1.15.
|
770
|
+
result = [month + 1, this.getUTCDate(),
|
771
|
+
this.getUTCHours(), this.getUTCMinutes(), this.getUTCSeconds()];
|
772
|
+
year = (
|
773
|
+
(year < 0 ? "-" : (year > 9999 ? "+" : "")) +
|
774
|
+
("00000" + Math.abs(year))
|
775
|
+
.slice(0 <= year && year <= 9999 ? -4 : -6)
|
776
|
+
);
|
777
|
+
|
778
|
+
length = result.length;
|
779
|
+
while (length--) {
|
780
|
+
value = result[length];
|
781
|
+
// pad months, days, hours, minutes, and seconds to have two
|
782
|
+
// digits.
|
783
|
+
if (value < 10) {
|
784
|
+
result[length] = "0" + value;
|
785
|
+
}
|
786
|
+
}
|
787
|
+
// pad milliseconds to have three digits.
|
788
|
+
return (
|
789
|
+
year + "-" + result.slice(0, 2).join("-") +
|
790
|
+
"T" + result.slice(2).join(":") + "." +
|
791
|
+
("000" + this.getUTCMilliseconds()).slice(-3) + "Z"
|
792
|
+
);
|
793
|
+
};
|
794
|
+
}
|
795
|
+
|
796
|
+
|
797
|
+
// ES5 15.9.5.44
|
798
|
+
// http://es5.github.com/#x15.9.5.44
|
799
|
+
// This function provides a String representation of a Date object for use by
|
800
|
+
// JSON.stringify (15.12.3).
|
801
|
+
var dateToJSONIsSupported = false;
|
802
|
+
try {
|
803
|
+
dateToJSONIsSupported = (
|
804
|
+
Date.prototype.toJSON &&
|
805
|
+
new Date(NaN).toJSON() === null &&
|
806
|
+
new Date(negativeDate).toJSON().indexOf(negativeYearString) !== -1 &&
|
807
|
+
Date.prototype.toJSON.call({ // generic
|
808
|
+
toISOString: function () {
|
809
|
+
return true;
|
810
|
+
}
|
811
|
+
})
|
812
|
+
);
|
813
|
+
} catch (e) {
|
814
|
+
}
|
815
|
+
if (!dateToJSONIsSupported) {
|
816
|
+
Date.prototype.toJSON = function toJSON(key) {
|
817
|
+
// When the toJSON method is called with argument key, the following
|
818
|
+
// steps are taken:
|
819
|
+
|
820
|
+
// 1. Let O be the result of calling ToObject, giving it the this
|
821
|
+
// value as its argument.
|
822
|
+
// 2. Let tv be toPrimitive(O, hint Number).
|
823
|
+
var o = Object(this),
|
824
|
+
tv = toPrimitive(o),
|
825
|
+
toISO;
|
826
|
+
// 3. If tv is a Number and is not finite, return null.
|
827
|
+
if (typeof tv === "number" && !isFinite(tv)) {
|
828
|
+
return null;
|
829
|
+
}
|
830
|
+
// 4. Let toISO be the result of calling the [[Get]] internal method of
|
831
|
+
// O with argument "toISOString".
|
832
|
+
toISO = o.toISOString;
|
833
|
+
// 5. If IsCallable(toISO) is false, throw a TypeError exception.
|
834
|
+
if (typeof toISO !== "function") {
|
835
|
+
throw new TypeError("toISOString property is not callable");
|
836
|
+
}
|
837
|
+
// 6. Return the result of calling the [[Call]] internal method of
|
838
|
+
// toISO with O as the this value and an empty argument list.
|
839
|
+
return toISO.call(o);
|
840
|
+
|
841
|
+
// NOTE 1 The argument is ignored.
|
842
|
+
|
843
|
+
// NOTE 2 The toJSON function is intentionally generic; it does not
|
844
|
+
// require that its this value be a Date object. Therefore, it can be
|
845
|
+
// transferred to other kinds of objects for use as a method. However,
|
846
|
+
// it does require that any such object have a toISOString method. An
|
847
|
+
// object is free to use the argument key to filter its
|
848
|
+
// stringification.
|
849
|
+
};
|
850
|
+
}
|
851
|
+
|
852
|
+
// ES5 15.9.4.2
|
853
|
+
// http://es5.github.com/#x15.9.4.2
|
854
|
+
// based on work shared by Daniel Friesen (dantman)
|
855
|
+
// http://gist.github.com/303249
|
856
|
+
var supportsExtendedYears = Date.parse('+033658-09-27T01:46:40.000Z') === 1e15;
|
857
|
+
var acceptsInvalidDates = !isNaN(Date.parse('2012-04-04T24:00:00.500Z')) || !isNaN(Date.parse('2012-11-31T23:59:59.000Z'));
|
858
|
+
var doesNotParseY2KNewYear = isNaN(Date.parse("2000-01-01T00:00:00.000Z"));
|
859
|
+
if (!Date.parse || doesNotParseY2KNewYear || acceptsInvalidDates || !supportsExtendedYears) {
|
860
|
+
// XXX global assignment won't work in embeddings that use
|
861
|
+
// an alternate object for the context.
|
862
|
+
Date = (function(NativeDate) {
|
863
|
+
|
864
|
+
// Date.length === 7
|
865
|
+
function Date(Y, M, D, h, m, s, ms) {
|
866
|
+
var length = arguments.length;
|
867
|
+
if (this instanceof NativeDate) {
|
868
|
+
var date = length === 1 && String(Y) === Y ? // isString(Y)
|
869
|
+
// We explicitly pass it through parse:
|
870
|
+
new NativeDate(Date.parse(Y)) :
|
871
|
+
// We have to manually make calls depending on argument
|
872
|
+
// length here
|
873
|
+
length >= 7 ? new NativeDate(Y, M, D, h, m, s, ms) :
|
874
|
+
length >= 6 ? new NativeDate(Y, M, D, h, m, s) :
|
875
|
+
length >= 5 ? new NativeDate(Y, M, D, h, m) :
|
876
|
+
length >= 4 ? new NativeDate(Y, M, D, h) :
|
877
|
+
length >= 3 ? new NativeDate(Y, M, D) :
|
878
|
+
length >= 2 ? new NativeDate(Y, M) :
|
879
|
+
length >= 1 ? new NativeDate(Y) :
|
880
|
+
new NativeDate();
|
881
|
+
// Prevent mixups with unfixed Date object
|
882
|
+
date.constructor = Date;
|
883
|
+
return date;
|
884
|
+
}
|
885
|
+
return NativeDate.apply(this, arguments);
|
886
|
+
}
|
887
|
+
|
888
|
+
// 15.9.1.15 Date Time String Format.
|
889
|
+
var isoDateExpression = new RegExp("^" +
|
890
|
+
"(\\d{4}|[\+\-]\\d{6})" + // four-digit year capture or sign +
|
891
|
+
// 6-digit extended year
|
892
|
+
"(?:-(\\d{2})" + // optional month capture
|
893
|
+
"(?:-(\\d{2})" + // optional day capture
|
894
|
+
"(?:" + // capture hours:minutes:seconds.milliseconds
|
895
|
+
"T(\\d{2})" + // hours capture
|
896
|
+
":(\\d{2})" + // minutes capture
|
897
|
+
"(?:" + // optional :seconds.milliseconds
|
898
|
+
":(\\d{2})" + // seconds capture
|
899
|
+
"(?:(\\.\\d{1,}))?" + // milliseconds capture
|
900
|
+
")?" +
|
901
|
+
"(" + // capture UTC offset component
|
902
|
+
"Z|" + // UTC capture
|
903
|
+
"(?:" + // offset specifier +/-hours:minutes
|
904
|
+
"([-+])" + // sign capture
|
905
|
+
"(\\d{2})" + // hours offset capture
|
906
|
+
":(\\d{2})" + // minutes offset capture
|
907
|
+
")" +
|
908
|
+
")?)?)?)?" +
|
909
|
+
"$");
|
910
|
+
|
911
|
+
var months = [
|
912
|
+
0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365
|
913
|
+
];
|
914
|
+
|
915
|
+
function dayFromMonth(year, month) {
|
916
|
+
var t = month > 1 ? 1 : 0;
|
917
|
+
return (
|
918
|
+
months[month] +
|
919
|
+
Math.floor((year - 1969 + t) / 4) -
|
920
|
+
Math.floor((year - 1901 + t) / 100) +
|
921
|
+
Math.floor((year - 1601 + t) / 400) +
|
922
|
+
365 * (year - 1970)
|
923
|
+
);
|
924
|
+
}
|
925
|
+
|
926
|
+
function toUTC(t) {
|
927
|
+
return Number(new NativeDate(1970, 0, 1, 0, 0, 0, t));
|
928
|
+
}
|
929
|
+
|
930
|
+
// Copy any custom methods a 3rd party library may have added
|
931
|
+
for (var key in NativeDate) {
|
932
|
+
Date[key] = NativeDate[key];
|
933
|
+
}
|
934
|
+
|
935
|
+
// Copy "native" methods explicitly; they may be non-enumerable
|
936
|
+
Date.now = NativeDate.now;
|
937
|
+
Date.UTC = NativeDate.UTC;
|
938
|
+
Date.prototype = NativeDate.prototype;
|
939
|
+
Date.prototype.constructor = Date;
|
940
|
+
|
941
|
+
// Upgrade Date.parse to handle simplified ISO 8601 strings
|
942
|
+
Date.parse = function parse(string) {
|
943
|
+
var match = isoDateExpression.exec(string);
|
944
|
+
if (match) {
|
945
|
+
// parse months, days, hours, minutes, seconds, and milliseconds
|
946
|
+
// provide default values if necessary
|
947
|
+
// parse the UTC offset component
|
948
|
+
var year = Number(match[1]),
|
949
|
+
month = Number(match[2] || 1) - 1,
|
950
|
+
day = Number(match[3] || 1) - 1,
|
951
|
+
hour = Number(match[4] || 0),
|
952
|
+
minute = Number(match[5] || 0),
|
953
|
+
second = Number(match[6] || 0),
|
954
|
+
millisecond = Math.floor(Number(match[7] || 0) * 1000),
|
955
|
+
// When time zone is missed, local offset should be used
|
956
|
+
// (ES 5.1 bug)
|
957
|
+
// see https://bugs.ecmascript.org/show_bug.cgi?id=112
|
958
|
+
isLocalTime = Boolean(match[4] && !match[8]),
|
959
|
+
signOffset = match[9] === "-" ? 1 : -1,
|
960
|
+
hourOffset = Number(match[10] || 0),
|
961
|
+
minuteOffset = Number(match[11] || 0),
|
962
|
+
result;
|
963
|
+
if (
|
964
|
+
hour < (
|
965
|
+
minute > 0 || second > 0 || millisecond > 0 ?
|
966
|
+
24 : 25
|
967
|
+
) &&
|
968
|
+
minute < 60 && second < 60 && millisecond < 1000 &&
|
969
|
+
month > -1 && month < 12 && hourOffset < 24 &&
|
970
|
+
minuteOffset < 60 && // detect invalid offsets
|
971
|
+
day > -1 &&
|
972
|
+
day < (
|
973
|
+
dayFromMonth(year, month + 1) -
|
974
|
+
dayFromMonth(year, month)
|
975
|
+
)
|
976
|
+
) {
|
977
|
+
result = (
|
978
|
+
(dayFromMonth(year, month) + day) * 24 +
|
979
|
+
hour +
|
980
|
+
hourOffset * signOffset
|
981
|
+
) * 60;
|
982
|
+
result = (
|
983
|
+
(result + minute + minuteOffset * signOffset) * 60 +
|
984
|
+
second
|
985
|
+
) * 1000 + millisecond;
|
986
|
+
if (isLocalTime) {
|
987
|
+
result = toUTC(result);
|
988
|
+
}
|
989
|
+
if (-8.64e15 <= result && result <= 8.64e15) {
|
990
|
+
return result;
|
991
|
+
}
|
992
|
+
}
|
993
|
+
return NaN;
|
994
|
+
}
|
995
|
+
return NativeDate.parse.apply(this, arguments);
|
996
|
+
};
|
997
|
+
|
998
|
+
return Date;
|
999
|
+
})(Date);
|
1000
|
+
}
|
1001
|
+
|
1002
|
+
// ES5 15.9.4.4
|
1003
|
+
// http://es5.github.com/#x15.9.4.4
|
1004
|
+
if (!Date.now) {
|
1005
|
+
Date.now = function now() {
|
1006
|
+
return new Date().getTime();
|
1007
|
+
};
|
1008
|
+
}
|
1009
|
+
|
1010
|
+
|
1011
|
+
//
|
1012
|
+
// Number
|
1013
|
+
// ======
|
1014
|
+
//
|
1015
|
+
|
1016
|
+
// ES5.1 15.7.4.5
|
1017
|
+
// http://es5.github.com/#x15.7.4.5
|
1018
|
+
if (!Number.prototype.toFixed || (0.00008).toFixed(3) !== '0.000' || (0.9).toFixed(0) === '0' || (1.255).toFixed(2) !== '1.25' || (1000000000000000128).toFixed(0) !== "1000000000000000128") {
|
1019
|
+
// Hide these variables and functions
|
1020
|
+
(function () {
|
1021
|
+
var base, size, data, i;
|
1022
|
+
|
1023
|
+
base = 1e7;
|
1024
|
+
size = 6;
|
1025
|
+
data = [0, 0, 0, 0, 0, 0];
|
1026
|
+
|
1027
|
+
function multiply(n, c) {
|
1028
|
+
var i = -1;
|
1029
|
+
while (++i < size) {
|
1030
|
+
c += n * data[i];
|
1031
|
+
data[i] = c % base;
|
1032
|
+
c = Math.floor(c / base);
|
1033
|
+
}
|
1034
|
+
}
|
1035
|
+
|
1036
|
+
function divide(n) {
|
1037
|
+
var i = size, c = 0;
|
1038
|
+
while (--i >= 0) {
|
1039
|
+
c += data[i];
|
1040
|
+
data[i] = Math.floor(c / n);
|
1041
|
+
c = (c % n) * base;
|
1042
|
+
}
|
1043
|
+
}
|
1044
|
+
|
1045
|
+
function toString() {
|
1046
|
+
var i = size;
|
1047
|
+
var s = '';
|
1048
|
+
while (--i >= 0) {
|
1049
|
+
if (s !== '' || i === 0 || data[i] !== 0) {
|
1050
|
+
var t = String(data[i]);
|
1051
|
+
if (s === '') {
|
1052
|
+
s = t;
|
1053
|
+
} else {
|
1054
|
+
s += '0000000'.slice(0, 7 - t.length) + t;
|
1055
|
+
}
|
1056
|
+
}
|
1057
|
+
}
|
1058
|
+
return s;
|
1059
|
+
}
|
1060
|
+
|
1061
|
+
function pow(x, n, acc) {
|
1062
|
+
return (n === 0 ? acc : (n % 2 === 1 ? pow(x, n - 1, acc * x) : pow(x * x, n / 2, acc)));
|
1063
|
+
}
|
1064
|
+
|
1065
|
+
function log(x) {
|
1066
|
+
var n = 0;
|
1067
|
+
while (x >= 4096) {
|
1068
|
+
n += 12;
|
1069
|
+
x /= 4096;
|
1070
|
+
}
|
1071
|
+
while (x >= 2) {
|
1072
|
+
n += 1;
|
1073
|
+
x /= 2;
|
1074
|
+
}
|
1075
|
+
return n;
|
1076
|
+
}
|
1077
|
+
|
1078
|
+
Number.prototype.toFixed = function toFixed(fractionDigits) {
|
1079
|
+
var f, x, s, m, e, z, j, k;
|
1080
|
+
|
1081
|
+
// Test for NaN and round fractionDigits down
|
1082
|
+
f = Number(fractionDigits);
|
1083
|
+
f = f !== f ? 0 : Math.floor(f);
|
1084
|
+
|
1085
|
+
if (f < 0 || f > 20) {
|
1086
|
+
throw new RangeError("Number.toFixed called with invalid number of decimals");
|
1087
|
+
}
|
1088
|
+
|
1089
|
+
x = Number(this);
|
1090
|
+
|
1091
|
+
// Test for NaN
|
1092
|
+
if (x !== x) {
|
1093
|
+
return "NaN";
|
1094
|
+
}
|
1095
|
+
|
1096
|
+
// If it is too big or small, return the string value of the number
|
1097
|
+
if (x <= -1e21 || x >= 1e21) {
|
1098
|
+
return String(x);
|
1099
|
+
}
|
1100
|
+
|
1101
|
+
s = "";
|
1102
|
+
|
1103
|
+
if (x < 0) {
|
1104
|
+
s = "-";
|
1105
|
+
x = -x;
|
1106
|
+
}
|
1107
|
+
|
1108
|
+
m = "0";
|
1109
|
+
|
1110
|
+
if (x > 1e-21) {
|
1111
|
+
// 1e-21 < x < 1e21
|
1112
|
+
// -70 < log2(x) < 70
|
1113
|
+
e = log(x * pow(2, 69, 1)) - 69;
|
1114
|
+
z = (e < 0 ? x * pow(2, -e, 1) : x / pow(2, e, 1));
|
1115
|
+
z *= 0x10000000000000; // Math.pow(2, 52);
|
1116
|
+
e = 52 - e;
|
1117
|
+
|
1118
|
+
// -18 < e < 122
|
1119
|
+
// x = z / 2 ^ e
|
1120
|
+
if (e > 0) {
|
1121
|
+
multiply(0, z);
|
1122
|
+
j = f;
|
1123
|
+
|
1124
|
+
while (j >= 7) {
|
1125
|
+
multiply(1e7, 0);
|
1126
|
+
j -= 7;
|
1127
|
+
}
|
1128
|
+
|
1129
|
+
multiply(pow(10, j, 1), 0);
|
1130
|
+
j = e - 1;
|
1131
|
+
|
1132
|
+
while (j >= 23) {
|
1133
|
+
divide(1 << 23);
|
1134
|
+
j -= 23;
|
1135
|
+
}
|
1136
|
+
|
1137
|
+
divide(1 << j);
|
1138
|
+
multiply(1, 1);
|
1139
|
+
divide(2);
|
1140
|
+
m = toString();
|
1141
|
+
} else {
|
1142
|
+
multiply(0, z);
|
1143
|
+
multiply(1 << (-e), 0);
|
1144
|
+
m = toString() + '0.00000000000000000000'.slice(2, 2 + f);
|
1145
|
+
}
|
1146
|
+
}
|
1147
|
+
|
1148
|
+
if (f > 0) {
|
1149
|
+
k = m.length;
|
1150
|
+
|
1151
|
+
if (k <= f) {
|
1152
|
+
m = s + '0.0000000000000000000'.slice(0, f - k + 2) + m;
|
1153
|
+
} else {
|
1154
|
+
m = s + m.slice(0, k - f) + '.' + m.slice(k - f);
|
1155
|
+
}
|
1156
|
+
} else {
|
1157
|
+
m = s + m;
|
1158
|
+
}
|
1159
|
+
|
1160
|
+
return m;
|
1161
|
+
};
|
1162
|
+
}());
|
1163
|
+
}
|
1164
|
+
|
1165
|
+
|
1166
|
+
//
|
1167
|
+
// String
|
1168
|
+
// ======
|
1169
|
+
//
|
1170
|
+
|
1171
|
+
|
1172
|
+
// ES5 15.5.4.14
|
1173
|
+
// http://es5.github.com/#x15.5.4.14
|
1174
|
+
|
1175
|
+
// [bugfix, IE lt 9, firefox 4, Konqueror, Opera, obscure browsers]
|
1176
|
+
// Many browsers do not split properly with regular expressions or they
|
1177
|
+
// do not perform the split correctly under obscure conditions.
|
1178
|
+
// See http://blog.stevenlevithan.com/archives/cross-browser-split
|
1179
|
+
// I've tested in many browsers and this seems to cover the deviant ones:
|
1180
|
+
// 'ab'.split(/(?:ab)*/) should be ["", ""], not [""]
|
1181
|
+
// '.'.split(/(.?)(.?)/) should be ["", ".", "", ""], not ["", ""]
|
1182
|
+
// 'tesst'.split(/(s)*/) should be ["t", undefined, "e", "s", "t"], not
|
1183
|
+
// [undefined, "t", undefined, "e", ...]
|
1184
|
+
// ''.split(/.?/) should be [], not [""]
|
1185
|
+
// '.'.split(/()()/) should be ["."], not ["", "", "."]
|
1186
|
+
|
1187
|
+
var string_split = String.prototype.split;
|
1188
|
+
if (
|
1189
|
+
'ab'.split(/(?:ab)*/).length !== 2 ||
|
1190
|
+
'.'.split(/(.?)(.?)/).length !== 4 ||
|
1191
|
+
'tesst'.split(/(s)*/)[1] === "t" ||
|
1192
|
+
''.split(/.?/).length ||
|
1193
|
+
'.'.split(/()()/).length > 1
|
1194
|
+
) {
|
1195
|
+
(function () {
|
1196
|
+
var compliantExecNpcg = /()??/.exec("")[1] === void 0; // NPCG: nonparticipating capturing group
|
1197
|
+
|
1198
|
+
String.prototype.split = function (separator, limit) {
|
1199
|
+
var string = this;
|
1200
|
+
if (separator === void 0 && limit === 0)
|
1201
|
+
return [];
|
1202
|
+
|
1203
|
+
// If `separator` is not a regex, use native split
|
1204
|
+
if (Object.prototype.toString.call(separator) !== "[object RegExp]") {
|
1205
|
+
return string_split.apply(this, arguments);
|
1206
|
+
}
|
1207
|
+
|
1208
|
+
var output = [],
|
1209
|
+
flags = (separator.ignoreCase ? "i" : "") +
|
1210
|
+
(separator.multiline ? "m" : "") +
|
1211
|
+
(separator.extended ? "x" : "") + // Proposed for ES6
|
1212
|
+
(separator.sticky ? "y" : ""), // Firefox 3+
|
1213
|
+
lastLastIndex = 0,
|
1214
|
+
// Make `global` and avoid `lastIndex` issues by working with a copy
|
1215
|
+
separator2, match, lastIndex, lastLength;
|
1216
|
+
separator = new RegExp(separator.source, flags + "g");
|
1217
|
+
string += ""; // Type-convert
|
1218
|
+
if (!compliantExecNpcg) {
|
1219
|
+
// Doesn't need flags gy, but they don't hurt
|
1220
|
+
separator2 = new RegExp("^" + separator.source + "$(?!\\s)", flags);
|
1221
|
+
}
|
1222
|
+
/* Values for `limit`, per the spec:
|
1223
|
+
* If undefined: 4294967295 // Math.pow(2, 32) - 1
|
1224
|
+
* If 0, Infinity, or NaN: 0
|
1225
|
+
* If positive number: limit = Math.floor(limit); if (limit > 4294967295) limit -= 4294967296;
|
1226
|
+
* If negative number: 4294967296 - Math.floor(Math.abs(limit))
|
1227
|
+
* If other: Type-convert, then use the above rules
|
1228
|
+
*/
|
1229
|
+
limit = limit === void 0 ?
|
1230
|
+
-1 >>> 0 : // Math.pow(2, 32) - 1
|
1231
|
+
limit >>> 0; // ToUint32(limit)
|
1232
|
+
while (match = separator.exec(string)) {
|
1233
|
+
// `separator.lastIndex` is not reliable cross-browser
|
1234
|
+
lastIndex = match.index + match[0].length;
|
1235
|
+
if (lastIndex > lastLastIndex) {
|
1236
|
+
output.push(string.slice(lastLastIndex, match.index));
|
1237
|
+
// Fix browsers whose `exec` methods don't consistently return `undefined` for
|
1238
|
+
// nonparticipating capturing groups
|
1239
|
+
if (!compliantExecNpcg && match.length > 1) {
|
1240
|
+
match[0].replace(separator2, function () {
|
1241
|
+
for (var i = 1; i < arguments.length - 2; i++) {
|
1242
|
+
if (arguments[i] === void 0) {
|
1243
|
+
match[i] = void 0;
|
1244
|
+
}
|
1245
|
+
}
|
1246
|
+
});
|
1247
|
+
}
|
1248
|
+
if (match.length > 1 && match.index < string.length) {
|
1249
|
+
Array.prototype.push.apply(output, match.slice(1));
|
1250
|
+
}
|
1251
|
+
lastLength = match[0].length;
|
1252
|
+
lastLastIndex = lastIndex;
|
1253
|
+
if (output.length >= limit) {
|
1254
|
+
break;
|
1255
|
+
}
|
1256
|
+
}
|
1257
|
+
if (separator.lastIndex === match.index) {
|
1258
|
+
separator.lastIndex++; // Avoid an infinite loop
|
1259
|
+
}
|
1260
|
+
}
|
1261
|
+
if (lastLastIndex === string.length) {
|
1262
|
+
if (lastLength || !separator.test("")) {
|
1263
|
+
output.push("");
|
1264
|
+
}
|
1265
|
+
} else {
|
1266
|
+
output.push(string.slice(lastLastIndex));
|
1267
|
+
}
|
1268
|
+
return output.length > limit ? output.slice(0, limit) : output;
|
1269
|
+
};
|
1270
|
+
}());
|
1271
|
+
|
1272
|
+
// [bugfix, chrome]
|
1273
|
+
// If separator is undefined, then the result array contains just one String,
|
1274
|
+
// which is the this value (converted to a String). If limit is not undefined,
|
1275
|
+
// then the output array is truncated so that it contains no more than limit
|
1276
|
+
// elements.
|
1277
|
+
// "0".split(undefined, 0) -> []
|
1278
|
+
} else if ("0".split(void 0, 0).length) {
|
1279
|
+
String.prototype.split = function split(separator, limit) {
|
1280
|
+
if (separator === void 0 && limit === 0) return [];
|
1281
|
+
return string_split.apply(this, arguments);
|
1282
|
+
};
|
1283
|
+
}
|
1284
|
+
|
1285
|
+
var str_replace = String.prototype.replace;
|
1286
|
+
var replaceReportsGroupsCorrectly = (function () {
|
1287
|
+
var groups = [];
|
1288
|
+
'x'.replace(/x(.)?/g, function (match, group) {
|
1289
|
+
groups.push(group);
|
1290
|
+
});
|
1291
|
+
return groups.length === 1 && typeof groups[0] === 'undefined';
|
1292
|
+
}());
|
1293
|
+
|
1294
|
+
if (!replaceReportsGroupsCorrectly) {
|
1295
|
+
String.prototype.replace = function replace(searchValue, replaceValue) {
|
1296
|
+
var isFn = isFunction(replaceValue);
|
1297
|
+
var hasCapturingGroups = isRegex(searchValue) && (/\)[*?]/).test(searchValue.source);
|
1298
|
+
if (!isFn || !hasCapturingGroups) {
|
1299
|
+
return str_replace.apply(this, arguments);
|
1300
|
+
} else {
|
1301
|
+
var wrappedReplaceValue = function (match) {
|
1302
|
+
var length = arguments.length;
|
1303
|
+
var originalLastIndex = searchValue.lastIndex;
|
1304
|
+
searchValue.lastIndex = 0;
|
1305
|
+
var args = searchValue.exec(match);
|
1306
|
+
searchValue.lastIndex = originalLastIndex;
|
1307
|
+
args.push(arguments[length - 2], arguments[length - 1]);
|
1308
|
+
return replaceValue.apply(this, args);
|
1309
|
+
};
|
1310
|
+
return str_replace.call(this, searchValue, wrappedReplaceValue);
|
1311
|
+
}
|
1312
|
+
};
|
1313
|
+
}
|
1314
|
+
|
1315
|
+
// ECMA-262, 3rd B.2.3
|
1316
|
+
// Note an ECMAScript standart, although ECMAScript 3rd Edition has a
|
1317
|
+
// non-normative section suggesting uniform semantics and it should be
|
1318
|
+
// normalized across all browsers
|
1319
|
+
// [bugfix, IE lt 9] IE < 9 substr() with negative value not working in IE
|
1320
|
+
if ("".substr && "0b".substr(-1) !== "b") {
|
1321
|
+
var string_substr = String.prototype.substr;
|
1322
|
+
/**
|
1323
|
+
* Get the substring of a string
|
1324
|
+
* @param {integer} start where to start the substring
|
1325
|
+
* @param {integer} length how many characters to return
|
1326
|
+
* @return {string}
|
1327
|
+
*/
|
1328
|
+
String.prototype.substr = function substr(start, length) {
|
1329
|
+
return string_substr.call(
|
1330
|
+
this,
|
1331
|
+
start < 0 ? ((start = this.length + start) < 0 ? 0 : start) : start,
|
1332
|
+
length
|
1333
|
+
);
|
1334
|
+
};
|
1335
|
+
}
|
1336
|
+
|
1337
|
+
// ES5 15.5.4.20
|
1338
|
+
// whitespace from: http://es5.github.io/#x15.5.4.20
|
1339
|
+
var ws = "\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003" +
|
1340
|
+
"\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028" +
|
1341
|
+
"\u2029\uFEFF";
|
1342
|
+
var zeroWidth = '\u200b';
|
1343
|
+
if (!String.prototype.trim || ws.trim() || !zeroWidth.trim()) {
|
1344
|
+
// http://blog.stevenlevithan.com/archives/faster-trim-javascript
|
1345
|
+
// http://perfectionkills.com/whitespace-deviations/
|
1346
|
+
ws = "[" + ws + "]";
|
1347
|
+
var trimBeginRegexp = new RegExp("^" + ws + ws + "*"),
|
1348
|
+
trimEndRegexp = new RegExp(ws + ws + "*$");
|
1349
|
+
String.prototype.trim = function trim() {
|
1350
|
+
if (this === void 0 || this === null) {
|
1351
|
+
throw new TypeError("can't convert "+this+" to object");
|
1352
|
+
}
|
1353
|
+
return String(this)
|
1354
|
+
.replace(trimBeginRegexp, "")
|
1355
|
+
.replace(trimEndRegexp, "");
|
1356
|
+
};
|
1357
|
+
}
|
1358
|
+
|
1359
|
+
// ES-5 15.1.2.2
|
1360
|
+
if (parseInt(ws + '08') !== 8 || parseInt(ws + '0x16') !== 22) {
|
1361
|
+
parseInt = (function (origParseInt) {
|
1362
|
+
var hexRegex = /^0[xX]/;
|
1363
|
+
return function parseIntES5(str, radix) {
|
1364
|
+
str = String(str).trim();
|
1365
|
+
if (!Number(radix)) {
|
1366
|
+
radix = hexRegex.test(str) ? 16 : 10;
|
1367
|
+
}
|
1368
|
+
return origParseInt(str, radix);
|
1369
|
+
};
|
1370
|
+
}(parseInt));
|
1371
|
+
}
|
1372
|
+
|
1373
|
+
//
|
1374
|
+
// Util
|
1375
|
+
// ======
|
1376
|
+
//
|
1377
|
+
|
1378
|
+
// ES5 9.4
|
1379
|
+
// http://es5.github.com/#x9.4
|
1380
|
+
// http://jsperf.com/to-integer
|
1381
|
+
|
1382
|
+
function toInteger(n) {
|
1383
|
+
n = +n;
|
1384
|
+
if (n !== n) { // isNaN
|
1385
|
+
n = 0;
|
1386
|
+
} else if (n !== 0 && n !== (1/0) && n !== -(1/0)) {
|
1387
|
+
n = (n > 0 || -1) * Math.floor(Math.abs(n));
|
1388
|
+
}
|
1389
|
+
return n;
|
1390
|
+
}
|
1391
|
+
|
1392
|
+
function isPrimitive(input) {
|
1393
|
+
var type = typeof input;
|
1394
|
+
return (
|
1395
|
+
input === null ||
|
1396
|
+
type === "undefined" ||
|
1397
|
+
type === "boolean" ||
|
1398
|
+
type === "number" ||
|
1399
|
+
type === "string"
|
1400
|
+
);
|
1401
|
+
}
|
1402
|
+
|
1403
|
+
function toPrimitive(input) {
|
1404
|
+
var val, valueOf, toStr;
|
1405
|
+
if (isPrimitive(input)) {
|
1406
|
+
return input;
|
1407
|
+
}
|
1408
|
+
valueOf = input.valueOf;
|
1409
|
+
if (isFunction(valueOf)) {
|
1410
|
+
val = valueOf.call(input);
|
1411
|
+
if (isPrimitive(val)) {
|
1412
|
+
return val;
|
1413
|
+
}
|
1414
|
+
}
|
1415
|
+
toStr = input.toString;
|
1416
|
+
if (isFunction(toStr)) {
|
1417
|
+
val = toStr.call(input);
|
1418
|
+
if (isPrimitive(val)) {
|
1419
|
+
return val;
|
1420
|
+
}
|
1421
|
+
}
|
1422
|
+
throw new TypeError();
|
1423
|
+
}
|
1424
|
+
|
1425
|
+
// ES5 9.9
|
1426
|
+
// http://es5.github.com/#x9.9
|
1427
|
+
var toObject = function (o) {
|
1428
|
+
if (o == null) { // this matches both null and undefined
|
1429
|
+
throw new TypeError("can't convert "+o+" to object");
|
1430
|
+
}
|
1431
|
+
return Object(o);
|
1432
|
+
};
|
1433
|
+
|
1434
|
+
}));
|
1435
|
+
|
1436
|
+
/*! JSON v3.3.2 | http://bestiejs.github.io/json3 | Copyright 2012-2014, Kit Cambridge | http://kit.mit-license.org */
|
1437
|
+
;(function () {
|
1438
|
+
// Detect the `define` function exposed by asynchronous module loaders. The
|
1439
|
+
// strict `define` check is necessary for compatibility with `r.js`.
|
1440
|
+
var isLoader = typeof define === "function" && define.amd;
|
1441
|
+
|
1442
|
+
// A set of types used to distinguish objects from primitives.
|
1443
|
+
var objectTypes = {
|
1444
|
+
"function": true,
|
1445
|
+
"object": true
|
1446
|
+
};
|
1447
|
+
|
1448
|
+
// Detect the `exports` object exposed by CommonJS implementations.
|
1449
|
+
var freeExports = objectTypes[typeof exports] && exports && !exports.nodeType && exports;
|
1450
|
+
|
1451
|
+
// Use the `global` object exposed by Node (including Browserify via
|
1452
|
+
// `insert-module-globals`), Narwhal, and Ringo as the default context,
|
1453
|
+
// and the `window` object in browsers. Rhino exports a `global` function
|
1454
|
+
// instead.
|
1455
|
+
var root = objectTypes[typeof window] && window || this,
|
1456
|
+
freeGlobal = freeExports && objectTypes[typeof module] && module && !module.nodeType && typeof global == "object" && global;
|
1457
|
+
|
1458
|
+
if (freeGlobal && (freeGlobal["global"] === freeGlobal || freeGlobal["window"] === freeGlobal || freeGlobal["self"] === freeGlobal)) {
|
1459
|
+
root = freeGlobal;
|
1460
|
+
}
|
1461
|
+
|
1462
|
+
// Public: Initializes JSON 3 using the given `context` object, attaching the
|
1463
|
+
// `stringify` and `parse` functions to the specified `exports` object.
|
1464
|
+
function runInContext(context, exports) {
|
1465
|
+
context || (context = root["Object"]());
|
1466
|
+
exports || (exports = root["Object"]());
|
1467
|
+
|
1468
|
+
// Native constructor aliases.
|
1469
|
+
var Number = context["Number"] || root["Number"],
|
1470
|
+
String = context["String"] || root["String"],
|
1471
|
+
Object = context["Object"] || root["Object"],
|
1472
|
+
Date = context["Date"] || root["Date"],
|
1473
|
+
SyntaxError = context["SyntaxError"] || root["SyntaxError"],
|
1474
|
+
TypeError = context["TypeError"] || root["TypeError"],
|
1475
|
+
Math = context["Math"] || root["Math"],
|
1476
|
+
nativeJSON = context["JSON"] || root["JSON"];
|
1477
|
+
|
1478
|
+
// Delegate to the native `stringify` and `parse` implementations.
|
1479
|
+
if (typeof nativeJSON == "object" && nativeJSON) {
|
1480
|
+
exports.stringify = nativeJSON.stringify;
|
1481
|
+
exports.parse = nativeJSON.parse;
|
1482
|
+
}
|
1483
|
+
|
1484
|
+
// Convenience aliases.
|
1485
|
+
var objectProto = Object.prototype,
|
1486
|
+
getClass = objectProto.toString,
|
1487
|
+
isProperty, forEach, undef;
|
1488
|
+
|
1489
|
+
// Test the `Date#getUTC*` methods. Based on work by @Yaffle.
|
1490
|
+
var isExtended = new Date(-3509827334573292);
|
1491
|
+
try {
|
1492
|
+
// The `getUTCFullYear`, `Month`, and `Date` methods return nonsensical
|
1493
|
+
// results for certain dates in Opera >= 10.53.
|
1494
|
+
isExtended = isExtended.getUTCFullYear() == -109252 && isExtended.getUTCMonth() === 0 && isExtended.getUTCDate() === 1 &&
|
1495
|
+
// Safari < 2.0.2 stores the internal millisecond time value correctly,
|
1496
|
+
// but clips the values returned by the date methods to the range of
|
1497
|
+
// signed 32-bit integers ([-2 ** 31, 2 ** 31 - 1]).
|
1498
|
+
isExtended.getUTCHours() == 10 && isExtended.getUTCMinutes() == 37 && isExtended.getUTCSeconds() == 6 && isExtended.getUTCMilliseconds() == 708;
|
1499
|
+
} catch (exception) {}
|
1500
|
+
|
1501
|
+
// Internal: Determines whether the native `JSON.stringify` and `parse`
|
1502
|
+
// implementations are spec-compliant. Based on work by Ken Snyder.
|
1503
|
+
function has(name) {
|
1504
|
+
if (has[name] !== undef) {
|
1505
|
+
// Return cached feature test result.
|
1506
|
+
return has[name];
|
1507
|
+
}
|
1508
|
+
var isSupported;
|
1509
|
+
if (name == "bug-string-char-index") {
|
1510
|
+
// IE <= 7 doesn't support accessing string characters using square
|
1511
|
+
// bracket notation. IE 8 only supports this for primitives.
|
1512
|
+
isSupported = "a"[0] != "a";
|
1513
|
+
} else if (name == "json") {
|
1514
|
+
// Indicates whether both `JSON.stringify` and `JSON.parse` are
|
1515
|
+
// supported.
|
1516
|
+
isSupported = has("json-stringify") && has("json-parse");
|
1517
|
+
} else {
|
1518
|
+
var value, serialized = '{"a":[1,true,false,null,"\\u0000\\b\\n\\f\\r\\t"]}';
|
1519
|
+
// Test `JSON.stringify`.
|
1520
|
+
if (name == "json-stringify") {
|
1521
|
+
var stringify = exports.stringify, stringifySupported = typeof stringify == "function" && isExtended;
|
1522
|
+
if (stringifySupported) {
|
1523
|
+
// A test function object with a custom `toJSON` method.
|
1524
|
+
(value = function () {
|
1525
|
+
return 1;
|
1526
|
+
}).toJSON = value;
|
1527
|
+
try {
|
1528
|
+
stringifySupported =
|
1529
|
+
// Firefox 3.1b1 and b2 serialize string, number, and boolean
|
1530
|
+
// primitives as object literals.
|
1531
|
+
stringify(0) === "0" &&
|
1532
|
+
// FF 3.1b1, b2, and JSON 2 serialize wrapped primitives as object
|
1533
|
+
// literals.
|
1534
|
+
stringify(new Number()) === "0" &&
|
1535
|
+
stringify(new String()) == '""' &&
|
1536
|
+
// FF 3.1b1, 2 throw an error if the value is `null`, `undefined`, or
|
1537
|
+
// does not define a canonical JSON representation (this applies to
|
1538
|
+
// objects with `toJSON` properties as well, *unless* they are nested
|
1539
|
+
// within an object or array).
|
1540
|
+
stringify(getClass) === undef &&
|
1541
|
+
// IE 8 serializes `undefined` as `"undefined"`. Safari <= 5.1.7 and
|
1542
|
+
// FF 3.1b3 pass this test.
|
1543
|
+
stringify(undef) === undef &&
|
1544
|
+
// Safari <= 5.1.7 and FF 3.1b3 throw `Error`s and `TypeError`s,
|
1545
|
+
// respectively, if the value is omitted entirely.
|
1546
|
+
stringify() === undef &&
|
1547
|
+
// FF 3.1b1, 2 throw an error if the given value is not a number,
|
1548
|
+
// string, array, object, Boolean, or `null` literal. This applies to
|
1549
|
+
// objects with custom `toJSON` methods as well, unless they are nested
|
1550
|
+
// inside object or array literals. YUI 3.0.0b1 ignores custom `toJSON`
|
1551
|
+
// methods entirely.
|
1552
|
+
stringify(value) === "1" &&
|
1553
|
+
stringify([value]) == "[1]" &&
|
1554
|
+
// Prototype <= 1.6.1 serializes `[undefined]` as `"[]"` instead of
|
1555
|
+
// `"[null]"`.
|
1556
|
+
stringify([undef]) == "[null]" &&
|
1557
|
+
// YUI 3.0.0b1 fails to serialize `null` literals.
|
1558
|
+
stringify(null) == "null" &&
|
1559
|
+
// FF 3.1b1, 2 halts serialization if an array contains a function:
|
1560
|
+
// `[1, true, getClass, 1]` serializes as "[1,true,],". FF 3.1b3
|
1561
|
+
// elides non-JSON values from objects and arrays, unless they
|
1562
|
+
// define custom `toJSON` methods.
|
1563
|
+
stringify([undef, getClass, null]) == "[null,null,null]" &&
|
1564
|
+
// Simple serialization test. FF 3.1b1 uses Unicode escape sequences
|
1565
|
+
// where character escape codes are expected (e.g., `\b` => `\u0008`).
|
1566
|
+
stringify({ "a": [value, true, false, null, "\x00\b\n\f\r\t"] }) == serialized &&
|
1567
|
+
// FF 3.1b1 and b2 ignore the `filter` and `width` arguments.
|
1568
|
+
stringify(null, value) === "1" &&
|
1569
|
+
stringify([1, 2], null, 1) == "[\n 1,\n 2\n]" &&
|
1570
|
+
// JSON 2, Prototype <= 1.7, and older WebKit builds incorrectly
|
1571
|
+
// serialize extended years.
|
1572
|
+
stringify(new Date(-8.64e15)) == '"-271821-04-20T00:00:00.000Z"' &&
|
1573
|
+
// The milliseconds are optional in ES 5, but required in 5.1.
|
1574
|
+
stringify(new Date(8.64e15)) == '"+275760-09-13T00:00:00.000Z"' &&
|
1575
|
+
// Firefox <= 11.0 incorrectly serializes years prior to 0 as negative
|
1576
|
+
// four-digit years instead of six-digit years. Credits: @Yaffle.
|
1577
|
+
stringify(new Date(-621987552e5)) == '"-000001-01-01T00:00:00.000Z"' &&
|
1578
|
+
// Safari <= 5.1.5 and Opera >= 10.53 incorrectly serialize millisecond
|
1579
|
+
// values less than 1000. Credits: @Yaffle.
|
1580
|
+
stringify(new Date(-1)) == '"1969-12-31T23:59:59.999Z"';
|
1581
|
+
} catch (exception) {
|
1582
|
+
stringifySupported = false;
|
1583
|
+
}
|
1584
|
+
}
|
1585
|
+
isSupported = stringifySupported;
|
1586
|
+
}
|
1587
|
+
// Test `JSON.parse`.
|
1588
|
+
if (name == "json-parse") {
|
1589
|
+
var parse = exports.parse;
|
1590
|
+
if (typeof parse == "function") {
|
1591
|
+
try {
|
1592
|
+
// FF 3.1b1, b2 will throw an exception if a bare literal is provided.
|
1593
|
+
// Conforming implementations should also coerce the initial argument to
|
1594
|
+
// a string prior to parsing.
|
1595
|
+
if (parse("0") === 0 && !parse(false)) {
|
1596
|
+
// Simple parsing test.
|
1597
|
+
value = parse(serialized);
|
1598
|
+
var parseSupported = value["a"].length == 5 && value["a"][0] === 1;
|
1599
|
+
if (parseSupported) {
|
1600
|
+
try {
|
1601
|
+
// Safari <= 5.1.2 and FF 3.1b1 allow unescaped tabs in strings.
|
1602
|
+
parseSupported = !parse('"\t"');
|
1603
|
+
} catch (exception) {}
|
1604
|
+
if (parseSupported) {
|
1605
|
+
try {
|
1606
|
+
// FF 4.0 and 4.0.1 allow leading `+` signs and leading
|
1607
|
+
// decimal points. FF 4.0, 4.0.1, and IE 9-10 also allow
|
1608
|
+
// certain octal literals.
|
1609
|
+
parseSupported = parse("01") !== 1;
|
1610
|
+
} catch (exception) {}
|
1611
|
+
}
|
1612
|
+
if (parseSupported) {
|
1613
|
+
try {
|
1614
|
+
// FF 4.0, 4.0.1, and Rhino 1.7R3-R4 allow trailing decimal
|
1615
|
+
// points. These environments, along with FF 3.1b1 and 2,
|
1616
|
+
// also allow trailing commas in JSON objects and arrays.
|
1617
|
+
parseSupported = parse("1.") !== 1;
|
1618
|
+
} catch (exception) {}
|
1619
|
+
}
|
1620
|
+
}
|
1621
|
+
}
|
1622
|
+
} catch (exception) {
|
1623
|
+
parseSupported = false;
|
1624
|
+
}
|
1625
|
+
}
|
1626
|
+
isSupported = parseSupported;
|
1627
|
+
}
|
1628
|
+
}
|
1629
|
+
return has[name] = !!isSupported;
|
1630
|
+
}
|
1631
|
+
|
1632
|
+
if (!has("json")) {
|
1633
|
+
// Common `[[Class]]` name aliases.
|
1634
|
+
var functionClass = "[object Function]",
|
1635
|
+
dateClass = "[object Date]",
|
1636
|
+
numberClass = "[object Number]",
|
1637
|
+
stringClass = "[object String]",
|
1638
|
+
arrayClass = "[object Array]",
|
1639
|
+
booleanClass = "[object Boolean]";
|
1640
|
+
|
1641
|
+
// Detect incomplete support for accessing string characters by index.
|
1642
|
+
var charIndexBuggy = has("bug-string-char-index");
|
1643
|
+
|
1644
|
+
// Define additional utility methods if the `Date` methods are buggy.
|
1645
|
+
if (!isExtended) {
|
1646
|
+
var floor = Math.floor;
|
1647
|
+
// A mapping between the months of the year and the number of days between
|
1648
|
+
// January 1st and the first of the respective month.
|
1649
|
+
var Months = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334];
|
1650
|
+
// Internal: Calculates the number of days between the Unix epoch and the
|
1651
|
+
// first day of the given month.
|
1652
|
+
var getDay = function (year, month) {
|
1653
|
+
return Months[month] + 365 * (year - 1970) + floor((year - 1969 + (month = +(month > 1))) / 4) - floor((year - 1901 + month) / 100) + floor((year - 1601 + month) / 400);
|
1654
|
+
};
|
1655
|
+
}
|
1656
|
+
|
1657
|
+
// Internal: Determines if a property is a direct property of the given
|
1658
|
+
// object. Delegates to the native `Object#hasOwnProperty` method.
|
1659
|
+
if (!(isProperty = objectProto.hasOwnProperty)) {
|
1660
|
+
isProperty = function (property) {
|
1661
|
+
var members = {}, constructor;
|
1662
|
+
if ((members.__proto__ = null, members.__proto__ = {
|
1663
|
+
// The *proto* property cannot be set multiple times in recent
|
1664
|
+
// versions of Firefox and SeaMonkey.
|
1665
|
+
"toString": 1
|
1666
|
+
}, members).toString != getClass) {
|
1667
|
+
// Safari <= 2.0.3 doesn't implement `Object#hasOwnProperty`, but
|
1668
|
+
// supports the mutable *proto* property.
|
1669
|
+
isProperty = function (property) {
|
1670
|
+
// Capture and break the object's prototype chain (see section 8.6.2
|
1671
|
+
// of the ES 5.1 spec). The parenthesized expression prevents an
|
1672
|
+
// unsafe transformation by the Closure Compiler.
|
1673
|
+
var original = this.__proto__, result = property in (this.__proto__ = null, this);
|
1674
|
+
// Restore the original prototype chain.
|
1675
|
+
this.__proto__ = original;
|
1676
|
+
return result;
|
1677
|
+
};
|
1678
|
+
} else {
|
1679
|
+
// Capture a reference to the top-level `Object` constructor.
|
1680
|
+
constructor = members.constructor;
|
1681
|
+
// Use the `constructor` property to simulate `Object#hasOwnProperty` in
|
1682
|
+
// other environments.
|
1683
|
+
isProperty = function (property) {
|
1684
|
+
var parent = (this.constructor || constructor).prototype;
|
1685
|
+
return property in this && !(property in parent && this[property] === parent[property]);
|
1686
|
+
};
|
1687
|
+
}
|
1688
|
+
members = null;
|
1689
|
+
return isProperty.call(this, property);
|
1690
|
+
};
|
1691
|
+
}
|
1692
|
+
|
1693
|
+
// Internal: Normalizes the `for...in` iteration algorithm across
|
1694
|
+
// environments. Each enumerated key is yielded to a `callback` function.
|
1695
|
+
forEach = function (object, callback) {
|
1696
|
+
var size = 0, Properties, members, property;
|
1697
|
+
|
1698
|
+
// Tests for bugs in the current environment's `for...in` algorithm. The
|
1699
|
+
// `valueOf` property inherits the non-enumerable flag from
|
1700
|
+
// `Object.prototype` in older versions of IE, Netscape, and Mozilla.
|
1701
|
+
(Properties = function () {
|
1702
|
+
this.valueOf = 0;
|
1703
|
+
}).prototype.valueOf = 0;
|
1704
|
+
|
1705
|
+
// Iterate over a new instance of the `Properties` class.
|
1706
|
+
members = new Properties();
|
1707
|
+
for (property in members) {
|
1708
|
+
// Ignore all properties inherited from `Object.prototype`.
|
1709
|
+
if (isProperty.call(members, property)) {
|
1710
|
+
size++;
|
1711
|
+
}
|
1712
|
+
}
|
1713
|
+
Properties = members = null;
|
1714
|
+
|
1715
|
+
// Normalize the iteration algorithm.
|
1716
|
+
if (!size) {
|
1717
|
+
// A list of non-enumerable properties inherited from `Object.prototype`.
|
1718
|
+
members = ["valueOf", "toString", "toLocaleString", "propertyIsEnumerable", "isPrototypeOf", "hasOwnProperty", "constructor"];
|
1719
|
+
// IE <= 8, Mozilla 1.0, and Netscape 6.2 ignore shadowed non-enumerable
|
1720
|
+
// properties.
|
1721
|
+
forEach = function (object, callback) {
|
1722
|
+
var isFunction = getClass.call(object) == functionClass, property, length;
|
1723
|
+
var hasProperty = !isFunction && typeof object.constructor != "function" && objectTypes[typeof object.hasOwnProperty] && object.hasOwnProperty || isProperty;
|
1724
|
+
for (property in object) {
|
1725
|
+
// Gecko <= 1.0 enumerates the `prototype` property of functions under
|
1726
|
+
// certain conditions; IE does not.
|
1727
|
+
if (!(isFunction && property == "prototype") && hasProperty.call(object, property)) {
|
1728
|
+
callback(property);
|
1729
|
+
}
|
1730
|
+
}
|
1731
|
+
// Manually invoke the callback for each non-enumerable property.
|
1732
|
+
for (length = members.length; property = members[--length]; hasProperty.call(object, property) && callback(property));
|
1733
|
+
};
|
1734
|
+
} else if (size == 2) {
|
1735
|
+
// Safari <= 2.0.4 enumerates shadowed properties twice.
|
1736
|
+
forEach = function (object, callback) {
|
1737
|
+
// Create a set of iterated properties.
|
1738
|
+
var members = {}, isFunction = getClass.call(object) == functionClass, property;
|
1739
|
+
for (property in object) {
|
1740
|
+
// Store each property name to prevent double enumeration. The
|
1741
|
+
// `prototype` property of functions is not enumerated due to cross-
|
1742
|
+
// environment inconsistencies.
|
1743
|
+
if (!(isFunction && property == "prototype") && !isProperty.call(members, property) && (members[property] = 1) && isProperty.call(object, property)) {
|
1744
|
+
callback(property);
|
1745
|
+
}
|
1746
|
+
}
|
1747
|
+
};
|
1748
|
+
} else {
|
1749
|
+
// No bugs detected; use the standard `for...in` algorithm.
|
1750
|
+
forEach = function (object, callback) {
|
1751
|
+
var isFunction = getClass.call(object) == functionClass, property, isConstructor;
|
1752
|
+
for (property in object) {
|
1753
|
+
if (!(isFunction && property == "prototype") && isProperty.call(object, property) && !(isConstructor = property === "constructor")) {
|
1754
|
+
callback(property);
|
1755
|
+
}
|
1756
|
+
}
|
1757
|
+
// Manually invoke the callback for the `constructor` property due to
|
1758
|
+
// cross-environment inconsistencies.
|
1759
|
+
if (isConstructor || isProperty.call(object, (property = "constructor"))) {
|
1760
|
+
callback(property);
|
1761
|
+
}
|
1762
|
+
};
|
1763
|
+
}
|
1764
|
+
return forEach(object, callback);
|
1765
|
+
};
|
1766
|
+
|
1767
|
+
// Public: Serializes a JavaScript `value` as a JSON string. The optional
|
1768
|
+
// `filter` argument may specify either a function that alters how object and
|
1769
|
+
// array members are serialized, or an array of strings and numbers that
|
1770
|
+
// indicates which properties should be serialized. The optional `width`
|
1771
|
+
// argument may be either a string or number that specifies the indentation
|
1772
|
+
// level of the output.
|
1773
|
+
if (!has("json-stringify")) {
|
1774
|
+
// Internal: A map of control characters and their escaped equivalents.
|
1775
|
+
var Escapes = {
|
1776
|
+
92: "\\\\",
|
1777
|
+
34: '\\"',
|
1778
|
+
8: "\\b",
|
1779
|
+
12: "\\f",
|
1780
|
+
10: "\\n",
|
1781
|
+
13: "\\r",
|
1782
|
+
9: "\\t"
|
1783
|
+
};
|
1784
|
+
|
1785
|
+
// Internal: Converts `value` into a zero-padded string such that its
|
1786
|
+
// length is at least equal to `width`. The `width` must be <= 6.
|
1787
|
+
var leadingZeroes = "000000";
|
1788
|
+
var toPaddedString = function (width, value) {
|
1789
|
+
// The `|| 0` expression is necessary to work around a bug in
|
1790
|
+
// Opera <= 7.54u2 where `0 == -0`, but `String(-0) !== "0"`.
|
1791
|
+
return (leadingZeroes + (value || 0)).slice(-width);
|
1792
|
+
};
|
1793
|
+
|
1794
|
+
// Internal: Double-quotes a string `value`, replacing all ASCII control
|
1795
|
+
// characters (characters with code unit values between 0 and 31) with
|
1796
|
+
// their escaped equivalents. This is an implementation of the
|
1797
|
+
// `Quote(value)` operation defined in ES 5.1 section 15.12.3.
|
1798
|
+
var unicodePrefix = "\\u00";
|
1799
|
+
var quote = function (value) {
|
1800
|
+
var result = '"', index = 0, length = value.length, useCharIndex = !charIndexBuggy || length > 10;
|
1801
|
+
var symbols = useCharIndex && (charIndexBuggy ? value.split("") : value);
|
1802
|
+
for (; index < length; index++) {
|
1803
|
+
var charCode = value.charCodeAt(index);
|
1804
|
+
// If the character is a control character, append its Unicode or
|
1805
|
+
// shorthand escape sequence; otherwise, append the character as-is.
|
1806
|
+
switch (charCode) {
|
1807
|
+
case 8: case 9: case 10: case 12: case 13: case 34: case 92:
|
1808
|
+
result += Escapes[charCode];
|
1809
|
+
break;
|
1810
|
+
default:
|
1811
|
+
if (charCode < 32) {
|
1812
|
+
result += unicodePrefix + toPaddedString(2, charCode.toString(16));
|
1813
|
+
break;
|
1814
|
+
}
|
1815
|
+
result += useCharIndex ? symbols[index] : value.charAt(index);
|
1816
|
+
}
|
1817
|
+
}
|
1818
|
+
return result + '"';
|
1819
|
+
};
|
1820
|
+
|
1821
|
+
// Internal: Recursively serializes an object. Implements the
|
1822
|
+
// `Str(key, holder)`, `JO(value)`, and `JA(value)` operations.
|
1823
|
+
var serialize = function (property, object, callback, properties, whitespace, indentation, stack) {
|
1824
|
+
var value, className, year, month, date, time, hours, minutes, seconds, milliseconds, results, element, index, length, prefix, result;
|
1825
|
+
try {
|
1826
|
+
// Necessary for host object support.
|
1827
|
+
value = object[property];
|
1828
|
+
} catch (exception) {}
|
1829
|
+
if (typeof value == "object" && value) {
|
1830
|
+
className = getClass.call(value);
|
1831
|
+
if (className == dateClass && !isProperty.call(value, "toJSON")) {
|
1832
|
+
if (value > -1 / 0 && value < 1 / 0) {
|
1833
|
+
// Dates are serialized according to the `Date#toJSON` method
|
1834
|
+
// specified in ES 5.1 section 15.9.5.44. See section 15.9.1.15
|
1835
|
+
// for the ISO 8601 date time string format.
|
1836
|
+
if (getDay) {
|
1837
|
+
// Manually compute the year, month, date, hours, minutes,
|
1838
|
+
// seconds, and milliseconds if the `getUTC*` methods are
|
1839
|
+
// buggy. Adapted from @Yaffle's `date-shim` project.
|
1840
|
+
date = floor(value / 864e5);
|
1841
|
+
for (year = floor(date / 365.2425) + 1970 - 1; getDay(year + 1, 0) <= date; year++);
|
1842
|
+
for (month = floor((date - getDay(year, 0)) / 30.42); getDay(year, month + 1) <= date; month++);
|
1843
|
+
date = 1 + date - getDay(year, month);
|
1844
|
+
// The `time` value specifies the time within the day (see ES
|
1845
|
+
// 5.1 section 15.9.1.2). The formula `(A % B + B) % B` is used
|
1846
|
+
// to compute `A modulo B`, as the `%` operator does not
|
1847
|
+
// correspond to the `modulo` operation for negative numbers.
|
1848
|
+
time = (value % 864e5 + 864e5) % 864e5;
|
1849
|
+
// The hours, minutes, seconds, and milliseconds are obtained by
|
1850
|
+
// decomposing the time within the day. See section 15.9.1.10.
|
1851
|
+
hours = floor(time / 36e5) % 24;
|
1852
|
+
minutes = floor(time / 6e4) % 60;
|
1853
|
+
seconds = floor(time / 1e3) % 60;
|
1854
|
+
milliseconds = time % 1e3;
|
1855
|
+
} else {
|
1856
|
+
year = value.getUTCFullYear();
|
1857
|
+
month = value.getUTCMonth();
|
1858
|
+
date = value.getUTCDate();
|
1859
|
+
hours = value.getUTCHours();
|
1860
|
+
minutes = value.getUTCMinutes();
|
1861
|
+
seconds = value.getUTCSeconds();
|
1862
|
+
milliseconds = value.getUTCMilliseconds();
|
1863
|
+
}
|
1864
|
+
// Serialize extended years correctly.
|
1865
|
+
value = (year <= 0 || year >= 1e4 ? (year < 0 ? "-" : "+") + toPaddedString(6, year < 0 ? -year : year) : toPaddedString(4, year)) +
|
1866
|
+
"-" + toPaddedString(2, month + 1) + "-" + toPaddedString(2, date) +
|
1867
|
+
// Months, dates, hours, minutes, and seconds should have two
|
1868
|
+
// digits; milliseconds should have three.
|
1869
|
+
"T" + toPaddedString(2, hours) + ":" + toPaddedString(2, minutes) + ":" + toPaddedString(2, seconds) +
|
1870
|
+
// Milliseconds are optional in ES 5.0, but required in 5.1.
|
1871
|
+
"." + toPaddedString(3, milliseconds) + "Z";
|
1872
|
+
} else {
|
1873
|
+
value = null;
|
1874
|
+
}
|
1875
|
+
} else if (typeof value.toJSON == "function" && ((className != numberClass && className != stringClass && className != arrayClass) || isProperty.call(value, "toJSON"))) {
|
1876
|
+
// Prototype <= 1.6.1 adds non-standard `toJSON` methods to the
|
1877
|
+
// `Number`, `String`, `Date`, and `Array` prototypes. JSON 3
|
1878
|
+
// ignores all `toJSON` methods on these objects unless they are
|
1879
|
+
// defined directly on an instance.
|
1880
|
+
value = value.toJSON(property);
|
1881
|
+
}
|
1882
|
+
}
|
1883
|
+
if (callback) {
|
1884
|
+
// If a replacement function was provided, call it to obtain the value
|
1885
|
+
// for serialization.
|
1886
|
+
value = callback.call(object, property, value);
|
1887
|
+
}
|
1888
|
+
if (value === null) {
|
1889
|
+
return "null";
|
1890
|
+
}
|
1891
|
+
className = getClass.call(value);
|
1892
|
+
if (className == booleanClass) {
|
1893
|
+
// Booleans are represented literally.
|
1894
|
+
return "" + value;
|
1895
|
+
} else if (className == numberClass) {
|
1896
|
+
// JSON numbers must be finite. `Infinity` and `NaN` are serialized as
|
1897
|
+
// `"null"`.
|
1898
|
+
return value > -1 / 0 && value < 1 / 0 ? "" + value : "null";
|
1899
|
+
} else if (className == stringClass) {
|
1900
|
+
// Strings are double-quoted and escaped.
|
1901
|
+
return quote("" + value);
|
1902
|
+
}
|
1903
|
+
// Recursively serialize objects and arrays.
|
1904
|
+
if (typeof value == "object") {
|
1905
|
+
// Check for cyclic structures. This is a linear search; performance
|
1906
|
+
// is inversely proportional to the number of unique nested objects.
|
1907
|
+
for (length = stack.length; length--;) {
|
1908
|
+
if (stack[length] === value) {
|
1909
|
+
// Cyclic structures cannot be serialized by `JSON.stringify`.
|
1910
|
+
throw TypeError();
|
1911
|
+
}
|
1912
|
+
}
|
1913
|
+
// Add the object to the stack of traversed objects.
|
1914
|
+
stack.push(value);
|
1915
|
+
results = [];
|
1916
|
+
// Save the current indentation level and indent one additional level.
|
1917
|
+
prefix = indentation;
|
1918
|
+
indentation += whitespace;
|
1919
|
+
if (className == arrayClass) {
|
1920
|
+
// Recursively serialize array elements.
|
1921
|
+
for (index = 0, length = value.length; index < length; index++) {
|
1922
|
+
element = serialize(index, value, callback, properties, whitespace, indentation, stack);
|
1923
|
+
results.push(element === undef ? "null" : element);
|
1924
|
+
}
|
1925
|
+
result = results.length ? (whitespace ? "[\n" + indentation + results.join(",\n" + indentation) + "\n" + prefix + "]" : ("[" + results.join(",") + "]")) : "[]";
|
1926
|
+
} else {
|
1927
|
+
// Recursively serialize object members. Members are selected from
|
1928
|
+
// either a user-specified list of property names, or the object
|
1929
|
+
// itself.
|
1930
|
+
forEach(properties || value, function (property) {
|
1931
|
+
var element = serialize(property, value, callback, properties, whitespace, indentation, stack);
|
1932
|
+
if (element !== undef) {
|
1933
|
+
// According to ES 5.1 section 15.12.3: "If `gap` {whitespace}
|
1934
|
+
// is not the empty string, let `member` {quote(property) + ":"}
|
1935
|
+
// be the concatenation of `member` and the `space` character."
|
1936
|
+
// The "`space` character" refers to the literal space
|
1937
|
+
// character, not the `space` {width} argument provided to
|
1938
|
+
// `JSON.stringify`.
|
1939
|
+
results.push(quote(property) + ":" + (whitespace ? " " : "") + element);
|
1940
|
+
}
|
1941
|
+
});
|
1942
|
+
result = results.length ? (whitespace ? "{\n" + indentation + results.join(",\n" + indentation) + "\n" + prefix + "}" : ("{" + results.join(",") + "}")) : "{}";
|
1943
|
+
}
|
1944
|
+
// Remove the object from the traversed object stack.
|
1945
|
+
stack.pop();
|
1946
|
+
return result;
|
1947
|
+
}
|
1948
|
+
};
|
1949
|
+
|
1950
|
+
// Public: `JSON.stringify`. See ES 5.1 section 15.12.3.
|
1951
|
+
exports.stringify = function (source, filter, width) {
|
1952
|
+
var whitespace, callback, properties, className;
|
1953
|
+
if (objectTypes[typeof filter] && filter) {
|
1954
|
+
if ((className = getClass.call(filter)) == functionClass) {
|
1955
|
+
callback = filter;
|
1956
|
+
} else if (className == arrayClass) {
|
1957
|
+
// Convert the property names array into a makeshift set.
|
1958
|
+
properties = {};
|
1959
|
+
for (var index = 0, length = filter.length, value; index < length; value = filter[index++], ((className = getClass.call(value)), className == stringClass || className == numberClass) && (properties[value] = 1));
|
1960
|
+
}
|
1961
|
+
}
|
1962
|
+
if (width) {
|
1963
|
+
if ((className = getClass.call(width)) == numberClass) {
|
1964
|
+
// Convert the `width` to an integer and create a string containing
|
1965
|
+
// `width` number of space characters.
|
1966
|
+
if ((width -= width % 1) > 0) {
|
1967
|
+
for (whitespace = "", width > 10 && (width = 10); whitespace.length < width; whitespace += " ");
|
1968
|
+
}
|
1969
|
+
} else if (className == stringClass) {
|
1970
|
+
whitespace = width.length <= 10 ? width : width.slice(0, 10);
|
1971
|
+
}
|
1972
|
+
}
|
1973
|
+
// Opera <= 7.54u2 discards the values associated with empty string keys
|
1974
|
+
// (`""`) only if they are used directly within an object member list
|
1975
|
+
// (e.g., `!("" in { "": 1})`).
|
1976
|
+
return serialize("", (value = {}, value[""] = source, value), callback, properties, whitespace, "", []);
|
1977
|
+
};
|
1978
|
+
}
|
1979
|
+
|
1980
|
+
// Public: Parses a JSON source string.
|
1981
|
+
if (!has("json-parse")) {
|
1982
|
+
var fromCharCode = String.fromCharCode;
|
1983
|
+
|
1984
|
+
// Internal: A map of escaped control characters and their unescaped
|
1985
|
+
// equivalents.
|
1986
|
+
var Unescapes = {
|
1987
|
+
92: "\\",
|
1988
|
+
34: '"',
|
1989
|
+
47: "/",
|
1990
|
+
98: "\b",
|
1991
|
+
116: "\t",
|
1992
|
+
110: "\n",
|
1993
|
+
102: "\f",
|
1994
|
+
114: "\r"
|
1995
|
+
};
|
1996
|
+
|
1997
|
+
// Internal: Stores the parser state.
|
1998
|
+
var Index, Source;
|
1999
|
+
|
2000
|
+
// Internal: Resets the parser state and throws a `SyntaxError`.
|
2001
|
+
var abort = function () {
|
2002
|
+
Index = Source = null;
|
2003
|
+
throw SyntaxError();
|
2004
|
+
};
|
2005
|
+
|
2006
|
+
// Internal: Returns the next token, or `"$"` if the parser has reached
|
2007
|
+
// the end of the source string. A token may be a string, number, `null`
|
2008
|
+
// literal, or Boolean literal.
|
2009
|
+
var lex = function () {
|
2010
|
+
var source = Source, length = source.length, value, begin, position, isSigned, charCode;
|
2011
|
+
while (Index < length) {
|
2012
|
+
charCode = source.charCodeAt(Index);
|
2013
|
+
switch (charCode) {
|
2014
|
+
case 9: case 10: case 13: case 32:
|
2015
|
+
// Skip whitespace tokens, including tabs, carriage returns, line
|
2016
|
+
// feeds, and space characters.
|
2017
|
+
Index++;
|
2018
|
+
break;
|
2019
|
+
case 123: case 125: case 91: case 93: case 58: case 44:
|
2020
|
+
// Parse a punctuator token (`{`, `}`, `[`, `]`, `:`, or `,`) at
|
2021
|
+
// the current position.
|
2022
|
+
value = charIndexBuggy ? source.charAt(Index) : source[Index];
|
2023
|
+
Index++;
|
2024
|
+
return value;
|
2025
|
+
case 34:
|
2026
|
+
// `"` delimits a JSON string; advance to the next character and
|
2027
|
+
// begin parsing the string. String tokens are prefixed with the
|
2028
|
+
// sentinel `@` character to distinguish them from punctuators and
|
2029
|
+
// end-of-string tokens.
|
2030
|
+
for (value = "@", Index++; Index < length;) {
|
2031
|
+
charCode = source.charCodeAt(Index);
|
2032
|
+
if (charCode < 32) {
|
2033
|
+
// Unescaped ASCII control characters (those with a code unit
|
2034
|
+
// less than the space character) are not permitted.
|
2035
|
+
abort();
|
2036
|
+
} else if (charCode == 92) {
|
2037
|
+
// A reverse solidus (`\`) marks the beginning of an escaped
|
2038
|
+
// control character (including `"`, `\`, and `/`) or Unicode
|
2039
|
+
// escape sequence.
|
2040
|
+
charCode = source.charCodeAt(++Index);
|
2041
|
+
switch (charCode) {
|
2042
|
+
case 92: case 34: case 47: case 98: case 116: case 110: case 102: case 114:
|
2043
|
+
// Revive escaped control characters.
|
2044
|
+
value += Unescapes[charCode];
|
2045
|
+
Index++;
|
2046
|
+
break;
|
2047
|
+
case 117:
|
2048
|
+
// `\u` marks the beginning of a Unicode escape sequence.
|
2049
|
+
// Advance to the first character and validate the
|
2050
|
+
// four-digit code point.
|
2051
|
+
begin = ++Index;
|
2052
|
+
for (position = Index + 4; Index < position; Index++) {
|
2053
|
+
charCode = source.charCodeAt(Index);
|
2054
|
+
// A valid sequence comprises four hexdigits (case-
|
2055
|
+
// insensitive) that form a single hexadecimal value.
|
2056
|
+
if (!(charCode >= 48 && charCode <= 57 || charCode >= 97 && charCode <= 102 || charCode >= 65 && charCode <= 70)) {
|
2057
|
+
// Invalid Unicode escape sequence.
|
2058
|
+
abort();
|
2059
|
+
}
|
2060
|
+
}
|
2061
|
+
// Revive the escaped character.
|
2062
|
+
value += fromCharCode("0x" + source.slice(begin, Index));
|
2063
|
+
break;
|
2064
|
+
default:
|
2065
|
+
// Invalid escape sequence.
|
2066
|
+
abort();
|
2067
|
+
}
|
2068
|
+
} else {
|
2069
|
+
if (charCode == 34) {
|
2070
|
+
// An unescaped double-quote character marks the end of the
|
2071
|
+
// string.
|
2072
|
+
break;
|
2073
|
+
}
|
2074
|
+
charCode = source.charCodeAt(Index);
|
2075
|
+
begin = Index;
|
2076
|
+
// Optimize for the common case where a string is valid.
|
2077
|
+
while (charCode >= 32 && charCode != 92 && charCode != 34) {
|
2078
|
+
charCode = source.charCodeAt(++Index);
|
2079
|
+
}
|
2080
|
+
// Append the string as-is.
|
2081
|
+
value += source.slice(begin, Index);
|
2082
|
+
}
|
2083
|
+
}
|
2084
|
+
if (source.charCodeAt(Index) == 34) {
|
2085
|
+
// Advance to the next character and return the revived string.
|
2086
|
+
Index++;
|
2087
|
+
return value;
|
2088
|
+
}
|
2089
|
+
// Unterminated string.
|
2090
|
+
abort();
|
2091
|
+
default:
|
2092
|
+
// Parse numbers and literals.
|
2093
|
+
begin = Index;
|
2094
|
+
// Advance past the negative sign, if one is specified.
|
2095
|
+
if (charCode == 45) {
|
2096
|
+
isSigned = true;
|
2097
|
+
charCode = source.charCodeAt(++Index);
|
2098
|
+
}
|
2099
|
+
// Parse an integer or floating-point value.
|
2100
|
+
if (charCode >= 48 && charCode <= 57) {
|
2101
|
+
// Leading zeroes are interpreted as octal literals.
|
2102
|
+
if (charCode == 48 && ((charCode = source.charCodeAt(Index + 1)), charCode >= 48 && charCode <= 57)) {
|
2103
|
+
// Illegal octal literal.
|
2104
|
+
abort();
|
2105
|
+
}
|
2106
|
+
isSigned = false;
|
2107
|
+
// Parse the integer component.
|
2108
|
+
for (; Index < length && ((charCode = source.charCodeAt(Index)), charCode >= 48 && charCode <= 57); Index++);
|
2109
|
+
// Floats cannot contain a leading decimal point; however, this
|
2110
|
+
// case is already accounted for by the parser.
|
2111
|
+
if (source.charCodeAt(Index) == 46) {
|
2112
|
+
position = ++Index;
|
2113
|
+
// Parse the decimal component.
|
2114
|
+
for (; position < length && ((charCode = source.charCodeAt(position)), charCode >= 48 && charCode <= 57); position++);
|
2115
|
+
if (position == Index) {
|
2116
|
+
// Illegal trailing decimal.
|
2117
|
+
abort();
|
2118
|
+
}
|
2119
|
+
Index = position;
|
2120
|
+
}
|
2121
|
+
// Parse exponents. The `e` denoting the exponent is
|
2122
|
+
// case-insensitive.
|
2123
|
+
charCode = source.charCodeAt(Index);
|
2124
|
+
if (charCode == 101 || charCode == 69) {
|
2125
|
+
charCode = source.charCodeAt(++Index);
|
2126
|
+
// Skip past the sign following the exponent, if one is
|
2127
|
+
// specified.
|
2128
|
+
if (charCode == 43 || charCode == 45) {
|
2129
|
+
Index++;
|
2130
|
+
}
|
2131
|
+
// Parse the exponential component.
|
2132
|
+
for (position = Index; position < length && ((charCode = source.charCodeAt(position)), charCode >= 48 && charCode <= 57); position++);
|
2133
|
+
if (position == Index) {
|
2134
|
+
// Illegal empty exponent.
|
2135
|
+
abort();
|
2136
|
+
}
|
2137
|
+
Index = position;
|
2138
|
+
}
|
2139
|
+
// Coerce the parsed value to a JavaScript number.
|
2140
|
+
return +source.slice(begin, Index);
|
2141
|
+
}
|
2142
|
+
// A negative sign may only precede numbers.
|
2143
|
+
if (isSigned) {
|
2144
|
+
abort();
|
2145
|
+
}
|
2146
|
+
// `true`, `false`, and `null` literals.
|
2147
|
+
if (source.slice(Index, Index + 4) == "true") {
|
2148
|
+
Index += 4;
|
2149
|
+
return true;
|
2150
|
+
} else if (source.slice(Index, Index + 5) == "false") {
|
2151
|
+
Index += 5;
|
2152
|
+
return false;
|
2153
|
+
} else if (source.slice(Index, Index + 4) == "null") {
|
2154
|
+
Index += 4;
|
2155
|
+
return null;
|
2156
|
+
}
|
2157
|
+
// Unrecognized token.
|
2158
|
+
abort();
|
2159
|
+
}
|
2160
|
+
}
|
2161
|
+
// Return the sentinel `$` character if the parser has reached the end
|
2162
|
+
// of the source string.
|
2163
|
+
return "$";
|
2164
|
+
};
|
2165
|
+
|
2166
|
+
// Internal: Parses a JSON `value` token.
|
2167
|
+
var get = function (value) {
|
2168
|
+
var results, hasMembers;
|
2169
|
+
if (value == "$") {
|
2170
|
+
// Unexpected end of input.
|
2171
|
+
abort();
|
2172
|
+
}
|
2173
|
+
if (typeof value == "string") {
|
2174
|
+
if ((charIndexBuggy ? value.charAt(0) : value[0]) == "@") {
|
2175
|
+
// Remove the sentinel `@` character.
|
2176
|
+
return value.slice(1);
|
2177
|
+
}
|
2178
|
+
// Parse object and array literals.
|
2179
|
+
if (value == "[") {
|
2180
|
+
// Parses a JSON array, returning a new JavaScript array.
|
2181
|
+
results = [];
|
2182
|
+
for (;; hasMembers || (hasMembers = true)) {
|
2183
|
+
value = lex();
|
2184
|
+
// A closing square bracket marks the end of the array literal.
|
2185
|
+
if (value == "]") {
|
2186
|
+
break;
|
2187
|
+
}
|
2188
|
+
// If the array literal contains elements, the current token
|
2189
|
+
// should be a comma separating the previous element from the
|
2190
|
+
// next.
|
2191
|
+
if (hasMembers) {
|
2192
|
+
if (value == ",") {
|
2193
|
+
value = lex();
|
2194
|
+
if (value == "]") {
|
2195
|
+
// Unexpected trailing `,` in array literal.
|
2196
|
+
abort();
|
2197
|
+
}
|
2198
|
+
} else {
|
2199
|
+
// A `,` must separate each array element.
|
2200
|
+
abort();
|
2201
|
+
}
|
2202
|
+
}
|
2203
|
+
// Elisions and leading commas are not permitted.
|
2204
|
+
if (value == ",") {
|
2205
|
+
abort();
|
2206
|
+
}
|
2207
|
+
results.push(get(value));
|
2208
|
+
}
|
2209
|
+
return results;
|
2210
|
+
} else if (value == "{") {
|
2211
|
+
// Parses a JSON object, returning a new JavaScript object.
|
2212
|
+
results = {};
|
2213
|
+
for (;; hasMembers || (hasMembers = true)) {
|
2214
|
+
value = lex();
|
2215
|
+
// A closing curly brace marks the end of the object literal.
|
2216
|
+
if (value == "}") {
|
2217
|
+
break;
|
2218
|
+
}
|
2219
|
+
// If the object literal contains members, the current token
|
2220
|
+
// should be a comma separator.
|
2221
|
+
if (hasMembers) {
|
2222
|
+
if (value == ",") {
|
2223
|
+
value = lex();
|
2224
|
+
if (value == "}") {
|
2225
|
+
// Unexpected trailing `,` in object literal.
|
2226
|
+
abort();
|
2227
|
+
}
|
2228
|
+
} else {
|
2229
|
+
// A `,` must separate each object member.
|
2230
|
+
abort();
|
2231
|
+
}
|
2232
|
+
}
|
2233
|
+
// Leading commas are not permitted, object property names must be
|
2234
|
+
// double-quoted strings, and a `:` must separate each property
|
2235
|
+
// name and value.
|
2236
|
+
if (value == "," || typeof value != "string" || (charIndexBuggy ? value.charAt(0) : value[0]) != "@" || lex() != ":") {
|
2237
|
+
abort();
|
2238
|
+
}
|
2239
|
+
results[value.slice(1)] = get(lex());
|
2240
|
+
}
|
2241
|
+
return results;
|
2242
|
+
}
|
2243
|
+
// Unexpected token encountered.
|
2244
|
+
abort();
|
2245
|
+
}
|
2246
|
+
return value;
|
2247
|
+
};
|
2248
|
+
|
2249
|
+
// Internal: Updates a traversed object member.
|
2250
|
+
var update = function (source, property, callback) {
|
2251
|
+
var element = walk(source, property, callback);
|
2252
|
+
if (element === undef) {
|
2253
|
+
delete source[property];
|
2254
|
+
} else {
|
2255
|
+
source[property] = element;
|
2256
|
+
}
|
2257
|
+
};
|
2258
|
+
|
2259
|
+
// Internal: Recursively traverses a parsed JSON object, invoking the
|
2260
|
+
// `callback` function for each value. This is an implementation of the
|
2261
|
+
// `Walk(holder, name)` operation defined in ES 5.1 section 15.12.2.
|
2262
|
+
var walk = function (source, property, callback) {
|
2263
|
+
var value = source[property], length;
|
2264
|
+
if (typeof value == "object" && value) {
|
2265
|
+
// `forEach` can't be used to traverse an array in Opera <= 8.54
|
2266
|
+
// because its `Object#hasOwnProperty` implementation returns `false`
|
2267
|
+
// for array indices (e.g., `![1, 2, 3].hasOwnProperty("0")`).
|
2268
|
+
if (getClass.call(value) == arrayClass) {
|
2269
|
+
for (length = value.length; length--;) {
|
2270
|
+
update(value, length, callback);
|
2271
|
+
}
|
2272
|
+
} else {
|
2273
|
+
forEach(value, function (property) {
|
2274
|
+
update(value, property, callback);
|
2275
|
+
});
|
2276
|
+
}
|
2277
|
+
}
|
2278
|
+
return callback.call(source, property, value);
|
2279
|
+
};
|
2280
|
+
|
2281
|
+
// Public: `JSON.parse`. See ES 5.1 section 15.12.2.
|
2282
|
+
exports.parse = function (source, callback) {
|
2283
|
+
var result, value;
|
2284
|
+
Index = 0;
|
2285
|
+
Source = "" + source;
|
2286
|
+
result = get(lex());
|
2287
|
+
// If a JSON string contains multiple tokens, it is invalid.
|
2288
|
+
if (lex() != "$") {
|
2289
|
+
abort();
|
2290
|
+
}
|
2291
|
+
// Reset the parser state.
|
2292
|
+
Index = Source = null;
|
2293
|
+
return callback && getClass.call(callback) == functionClass ? walk((value = {}, value[""] = result, value), "", callback) : result;
|
2294
|
+
};
|
2295
|
+
}
|
2296
|
+
}
|
2297
|
+
|
2298
|
+
exports["runInContext"] = runInContext;
|
2299
|
+
return exports;
|
2300
|
+
}
|
2301
|
+
|
2302
|
+
if (freeExports && !isLoader) {
|
2303
|
+
// Export for CommonJS environments.
|
2304
|
+
runInContext(root, freeExports);
|
2305
|
+
} else {
|
2306
|
+
// Export for web browsers and JavaScript engines.
|
2307
|
+
var nativeJSON = root.JSON,
|
2308
|
+
previousJSON = root["JSON3"],
|
2309
|
+
isRestored = false;
|
2310
|
+
|
2311
|
+
var JSON3 = runInContext(root, (root["JSON3"] = {
|
2312
|
+
// Public: Restores the original value of the global `JSON` object and
|
2313
|
+
// returns a reference to the `JSON3` object.
|
2314
|
+
"noConflict": function () {
|
2315
|
+
if (!isRestored) {
|
2316
|
+
isRestored = true;
|
2317
|
+
root.JSON = nativeJSON;
|
2318
|
+
root["JSON3"] = previousJSON;
|
2319
|
+
nativeJSON = previousJSON = null;
|
2320
|
+
}
|
2321
|
+
return JSON3;
|
2322
|
+
}
|
2323
|
+
}));
|
2324
|
+
|
2325
|
+
root.JSON = {
|
2326
|
+
"parse": JSON3.parse,
|
2327
|
+
"stringify": JSON3.stringify
|
2328
|
+
};
|
2329
|
+
}
|
2330
|
+
|
2331
|
+
// Export for asynchronous module loaders.
|
2332
|
+
if (isLoader) {
|
2333
|
+
define(function () {
|
2334
|
+
return JSON3;
|
2335
|
+
});
|
2336
|
+
}
|
2337
|
+
}).call(this);
|