@proteinjs/reflection-build 1.2.1 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +22 -0
- package/{test/examples/source-repository/a/node_modules/glob-watcher/node_modules/fsevents/LICENSE → LICENSE} +5 -6
- package/dist/src/build.js +31 -15
- package/dist/src/build.js.map +1 -1
- package/dist/src/codegen/writeGeneratedIndex.d.ts +10 -1
- package/dist/src/codegen/writeGeneratedIndex.js +43 -12
- package/dist/src/codegen/writeGeneratedIndex.js.map +1 -1
- package/dist/src/parser/createSourceGraph.d.ts +1 -1
- package/dist/src/parser/createSourceGraph.js +36 -22
- package/dist/src/parser/createSourceGraph.js.map +1 -1
- package/dist/test/examples/source-repository/a/generated/index.js +1 -1
- package/dist/test/examples/source-repository/a/generated/index.js.map +1 -1
- package/dist/test/examples/source-repository/b/generated/index.js +1 -1
- package/dist/test/examples/source-repository/b/generated/index.js.map +1 -1
- package/package.json +4 -3
- package/src/build.ts +52 -14
- package/src/codegen/writeGeneratedIndex.ts +60 -7
- package/src/parser/createSourceGraph.ts +21 -12
- package/test/examples/source-repository/a/dist/build.js +31 -15
- package/test/examples/source-repository/a/dist/build.js.map +1 -1
- package/test/examples/source-repository/a/dist/codegen/writeGeneratedIndex.d.ts +10 -1
- package/test/examples/source-repository/a/dist/codegen/writeGeneratedIndex.js +43 -12
- package/test/examples/source-repository/a/dist/codegen/writeGeneratedIndex.js.map +1 -1
- package/test/examples/source-repository/a/dist/generated/index.js +1 -1
- package/test/examples/source-repository/a/dist/generated/index.js.map +1 -1
- package/test/examples/source-repository/a/dist/parser/createSourceGraph.d.ts +1 -1
- package/test/examples/source-repository/a/dist/parser/createSourceGraph.js +36 -22
- package/test/examples/source-repository/a/dist/parser/createSourceGraph.js.map +1 -1
- package/test/examples/source-repository/a/generated/index.ts +38 -33
- package/test/examples/source-repository/a/node_modules/.package-lock.json +0 -53
- package/test/examples/source-repository/a/package.json +1 -1
- package/test/examples/source-repository/b/dist/build.js +31 -15
- package/test/examples/source-repository/b/dist/build.js.map +1 -1
- package/test/examples/source-repository/b/dist/codegen/writeGeneratedIndex.d.ts +10 -1
- package/test/examples/source-repository/b/dist/codegen/writeGeneratedIndex.js +43 -12
- package/test/examples/source-repository/b/dist/codegen/writeGeneratedIndex.js.map +1 -1
- package/test/examples/source-repository/b/dist/generated/index.js +1 -1
- package/test/examples/source-repository/b/dist/generated/index.js.map +1 -1
- package/test/examples/source-repository/b/dist/parser/createSourceGraph.d.ts +1 -1
- package/test/examples/source-repository/b/dist/parser/createSourceGraph.js +36 -22
- package/test/examples/source-repository/b/dist/parser/createSourceGraph.js.map +1 -1
- package/test/examples/source-repository/b/generated/index.ts +10 -11
- package/test/examples/source-repository/b/node_modules/.package-lock.json +0 -53
- package/test/examples/source-repository/b/package.json +1 -1
- package/test/examples/source-repository/a/node_modules/@proteinjs/reflection/.eslintrc.js +0 -20
- package/test/examples/source-repository/a/node_modules/@proteinjs/reflection/.prettierignore +0 -4
- package/test/examples/source-repository/a/node_modules/@proteinjs/reflection/.prettierrc +0 -8
- package/test/examples/source-repository/a/node_modules/@proteinjs/reflection/CHANGELOG.md +0 -58
- package/test/examples/source-repository/a/node_modules/@proteinjs/reflection/dist/index.d.ts +0 -5
- package/test/examples/source-repository/a/node_modules/@proteinjs/reflection/dist/index.js +0 -18
- package/test/examples/source-repository/a/node_modules/@proteinjs/reflection/dist/index.js.map +0 -1
- package/test/examples/source-repository/a/node_modules/@proteinjs/reflection/dist/src/FlattenedSourceGraph.d.ts +0 -19
- package/test/examples/source-repository/a/node_modules/@proteinjs/reflection/dist/src/FlattenedSourceGraph.js +0 -555
- package/test/examples/source-repository/a/node_modules/@proteinjs/reflection/dist/src/FlattenedSourceGraph.js.map +0 -1
- package/test/examples/source-repository/a/node_modules/@proteinjs/reflection/dist/src/Loadable.d.ts +0 -3
- package/test/examples/source-repository/a/node_modules/@proteinjs/reflection/dist/src/Loadable.js +0 -5
- package/test/examples/source-repository/a/node_modules/@proteinjs/reflection/dist/src/Loadable.js.map +0 -1
- package/test/examples/source-repository/a/node_modules/@proteinjs/reflection/dist/src/SourceRepository.d.ts +0 -45
- package/test/examples/source-repository/a/node_modules/@proteinjs/reflection/dist/src/SourceRepository.js +0 -176
- package/test/examples/source-repository/a/node_modules/@proteinjs/reflection/dist/src/SourceRepository.js.map +0 -1
- package/test/examples/source-repository/a/node_modules/@proteinjs/reflection/dist/src/SourceRepositoryFilter.d.ts +0 -11
- package/test/examples/source-repository/a/node_modules/@proteinjs/reflection/dist/src/SourceRepositoryFilter.js +0 -9
- package/test/examples/source-repository/a/node_modules/@proteinjs/reflection/dist/src/SourceRepositoryFilter.js.map +0 -1
- package/test/examples/source-repository/a/node_modules/@proteinjs/reflection/dist/src/sourceGraphTypes.d.ts +0 -13
- package/test/examples/source-repository/a/node_modules/@proteinjs/reflection/dist/src/sourceGraphTypes.js +0 -19
- package/test/examples/source-repository/a/node_modules/@proteinjs/reflection/dist/src/sourceGraphTypes.js.map +0 -1
- package/test/examples/source-repository/a/node_modules/@proteinjs/reflection/dist/src/types.d.ts +0 -221
- package/test/examples/source-repository/a/node_modules/@proteinjs/reflection/dist/src/types.js +0 -234
- package/test/examples/source-repository/a/node_modules/@proteinjs/reflection/dist/src/types.js.map +0 -1
- package/test/examples/source-repository/a/node_modules/@proteinjs/reflection/index.ts +0 -5
- package/test/examples/source-repository/a/node_modules/@proteinjs/reflection/jest.config.js +0 -9
- package/test/examples/source-repository/a/node_modules/@proteinjs/reflection/package.json +0 -42
- package/test/examples/source-repository/a/node_modules/@proteinjs/reflection/src/FlattenedSourceGraph.ts +0 -702
- package/test/examples/source-repository/a/node_modules/@proteinjs/reflection/src/Loadable.ts +0 -2
- package/test/examples/source-repository/a/node_modules/@proteinjs/reflection/src/SourceRepository.ts +0 -250
- package/test/examples/source-repository/a/node_modules/@proteinjs/reflection/src/SourceRepositoryFilter.ts +0 -15
- package/test/examples/source-repository/a/node_modules/@proteinjs/reflection/src/sourceGraphTypes.ts +0 -14
- package/test/examples/source-repository/a/node_modules/@proteinjs/reflection/src/types.ts +0 -236
- package/test/examples/source-repository/a/node_modules/@proteinjs/reflection/tsconfig.json +0 -19
- package/test/examples/source-repository/a/node_modules/@proteinjs/reflection/types/@dagrejs/graphlib.d.ts +0 -1
- package/test/examples/source-repository/a/node_modules/bindings/LICENSE.md +0 -22
- package/test/examples/source-repository/a/node_modules/bindings/README.md +0 -98
- package/test/examples/source-repository/a/node_modules/bindings/bindings.js +0 -221
- package/test/examples/source-repository/a/node_modules/bindings/package.json +0 -28
- package/test/examples/source-repository/a/node_modules/file-uri-to-path/.travis.yml +0 -30
- package/test/examples/source-repository/a/node_modules/file-uri-to-path/History.md +0 -21
- package/test/examples/source-repository/a/node_modules/file-uri-to-path/LICENSE +0 -20
- package/test/examples/source-repository/a/node_modules/file-uri-to-path/README.md +0 -74
- package/test/examples/source-repository/a/node_modules/file-uri-to-path/index.d.ts +0 -2
- package/test/examples/source-repository/a/node_modules/file-uri-to-path/index.js +0 -66
- package/test/examples/source-repository/a/node_modules/file-uri-to-path/package.json +0 -32
- package/test/examples/source-repository/a/node_modules/file-uri-to-path/test/test.js +0 -24
- package/test/examples/source-repository/a/node_modules/file-uri-to-path/test/tests.json +0 -13
- package/test/examples/source-repository/a/node_modules/fsevents/LICENSE +0 -22
- package/test/examples/source-repository/a/node_modules/fsevents/README.md +0 -89
- package/test/examples/source-repository/a/node_modules/fsevents/fsevents.d.ts +0 -46
- package/test/examples/source-repository/a/node_modules/fsevents/fsevents.js +0 -83
- package/test/examples/source-repository/a/node_modules/fsevents/fsevents.node +0 -0
- package/test/examples/source-repository/a/node_modules/fsevents/package.json +0 -62
- package/test/examples/source-repository/a/node_modules/glob-watcher/node_modules/fsevents/.travis.yml +0 -103
- package/test/examples/source-repository/a/node_modules/glob-watcher/node_modules/fsevents/ISSUE_TEMPLATE.md +0 -8
- package/test/examples/source-repository/a/node_modules/glob-watcher/node_modules/fsevents/Readme.md +0 -78
- package/test/examples/source-repository/a/node_modules/glob-watcher/node_modules/fsevents/binding.gyp +0 -21
- package/test/examples/source-repository/a/node_modules/glob-watcher/node_modules/fsevents/build/.target.mk +0 -53
- package/test/examples/source-repository/a/node_modules/glob-watcher/node_modules/fsevents/build/Makefile +0 -352
- package/test/examples/source-repository/a/node_modules/glob-watcher/node_modules/fsevents/build/Release/.deps/Release/.node.d +0 -1
- package/test/examples/source-repository/a/node_modules/glob-watcher/node_modules/fsevents/build/Release/.deps/Release/obj.target/fse/fsevents.o.d.raw +0 -75
- package/test/examples/source-repository/a/node_modules/glob-watcher/node_modules/fsevents/build/Release/.node +0 -0
- package/test/examples/source-repository/a/node_modules/glob-watcher/node_modules/fsevents/build/binding.Makefile +0 -6
- package/test/examples/source-repository/a/node_modules/glob-watcher/node_modules/fsevents/build/fse.target.mk +0 -188
- package/test/examples/source-repository/a/node_modules/glob-watcher/node_modules/fsevents/build/gyp-mac-tool +0 -772
- package/test/examples/source-repository/a/node_modules/glob-watcher/node_modules/fsevents/fsevents.cc +0 -88
- package/test/examples/source-repository/a/node_modules/glob-watcher/node_modules/fsevents/fsevents.js +0 -106
- package/test/examples/source-repository/a/node_modules/glob-watcher/node_modules/fsevents/install.js +0 -13
- package/test/examples/source-repository/a/node_modules/glob-watcher/node_modules/fsevents/package.json +0 -34
- package/test/examples/source-repository/a/node_modules/glob-watcher/node_modules/fsevents/src/async.cc +0 -43
- package/test/examples/source-repository/a/node_modules/glob-watcher/node_modules/fsevents/src/constants.cc +0 -110
- package/test/examples/source-repository/a/node_modules/glob-watcher/node_modules/fsevents/src/methods.cc +0 -44
- package/test/examples/source-repository/a/node_modules/glob-watcher/node_modules/fsevents/src/storage.cc +0 -27
- package/test/examples/source-repository/a/node_modules/glob-watcher/node_modules/fsevents/src/thread.cc +0 -71
- package/test/examples/source-repository/a/node_modules/nan/CHANGELOG.md +0 -557
- package/test/examples/source-repository/a/node_modules/nan/CMakeLists.txt +0 -138
- package/test/examples/source-repository/a/node_modules/nan/LICENSE.md +0 -9
- package/test/examples/source-repository/a/node_modules/nan/README.md +0 -456
- package/test/examples/source-repository/a/node_modules/nan/doc/asyncworker.md +0 -146
- package/test/examples/source-repository/a/node_modules/nan/doc/buffers.md +0 -54
- package/test/examples/source-repository/a/node_modules/nan/doc/callback.md +0 -76
- package/test/examples/source-repository/a/node_modules/nan/doc/converters.md +0 -41
- package/test/examples/source-repository/a/node_modules/nan/doc/errors.md +0 -226
- package/test/examples/source-repository/a/node_modules/nan/doc/json.md +0 -62
- package/test/examples/source-repository/a/node_modules/nan/doc/maybe_types.md +0 -583
- package/test/examples/source-repository/a/node_modules/nan/doc/methods.md +0 -672
- package/test/examples/source-repository/a/node_modules/nan/doc/new.md +0 -147
- package/test/examples/source-repository/a/node_modules/nan/doc/node_misc.md +0 -123
- package/test/examples/source-repository/a/node_modules/nan/doc/object_wrappers.md +0 -263
- package/test/examples/source-repository/a/node_modules/nan/doc/persistent.md +0 -296
- package/test/examples/source-repository/a/node_modules/nan/doc/scopes.md +0 -73
- package/test/examples/source-repository/a/node_modules/nan/doc/script.md +0 -58
- package/test/examples/source-repository/a/node_modules/nan/doc/string_bytes.md +0 -62
- package/test/examples/source-repository/a/node_modules/nan/doc/v8_internals.md +0 -199
- package/test/examples/source-repository/a/node_modules/nan/doc/v8_misc.md +0 -85
- package/test/examples/source-repository/a/node_modules/nan/include_dirs.js +0 -1
- package/test/examples/source-repository/a/node_modules/nan/nan.h +0 -2958
- package/test/examples/source-repository/a/node_modules/nan/nan_callbacks.h +0 -92
- package/test/examples/source-repository/a/node_modules/nan/nan_callbacks_12_inl.h +0 -520
- package/test/examples/source-repository/a/node_modules/nan/nan_callbacks_pre_12_inl.h +0 -520
- package/test/examples/source-repository/a/node_modules/nan/nan_converters.h +0 -72
- package/test/examples/source-repository/a/node_modules/nan/nan_converters_43_inl.h +0 -68
- package/test/examples/source-repository/a/node_modules/nan/nan_converters_pre_43_inl.h +0 -42
- package/test/examples/source-repository/a/node_modules/nan/nan_define_own_property_helper.h +0 -29
- package/test/examples/source-repository/a/node_modules/nan/nan_implementation_12_inl.h +0 -430
- package/test/examples/source-repository/a/node_modules/nan/nan_implementation_pre_12_inl.h +0 -263
- package/test/examples/source-repository/a/node_modules/nan/nan_json.h +0 -166
- package/test/examples/source-repository/a/node_modules/nan/nan_maybe_43_inl.h +0 -356
- package/test/examples/source-repository/a/node_modules/nan/nan_maybe_pre_43_inl.h +0 -268
- package/test/examples/source-repository/a/node_modules/nan/nan_new.h +0 -340
- package/test/examples/source-repository/a/node_modules/nan/nan_object_wrap.h +0 -156
- package/test/examples/source-repository/a/node_modules/nan/nan_persistent_12_inl.h +0 -132
- package/test/examples/source-repository/a/node_modules/nan/nan_persistent_pre_12_inl.h +0 -242
- package/test/examples/source-repository/a/node_modules/nan/nan_private.h +0 -73
- package/test/examples/source-repository/a/node_modules/nan/nan_scriptorigin.h +0 -76
- package/test/examples/source-repository/a/node_modules/nan/nan_string_bytes.h +0 -305
- package/test/examples/source-repository/a/node_modules/nan/nan_typedarray_contents.h +0 -96
- package/test/examples/source-repository/a/node_modules/nan/nan_weak.h +0 -437
- package/test/examples/source-repository/a/node_modules/nan/package.json +0 -38
- package/test/examples/source-repository/a/node_modules/nan/tools/1to2.js +0 -412
- package/test/examples/source-repository/a/node_modules/nan/tools/README.md +0 -14
- package/test/examples/source-repository/a/node_modules/nan/tools/package.json +0 -19
- package/test/examples/source-repository/b/node_modules/@proteinjs/reflection/.eslintrc.js +0 -20
- package/test/examples/source-repository/b/node_modules/@proteinjs/reflection/.prettierignore +0 -4
- package/test/examples/source-repository/b/node_modules/@proteinjs/reflection/.prettierrc +0 -8
- package/test/examples/source-repository/b/node_modules/@proteinjs/reflection/CHANGELOG.md +0 -58
- package/test/examples/source-repository/b/node_modules/@proteinjs/reflection/dist/index.d.ts +0 -5
- package/test/examples/source-repository/b/node_modules/@proteinjs/reflection/dist/index.js +0 -18
- package/test/examples/source-repository/b/node_modules/@proteinjs/reflection/dist/index.js.map +0 -1
- package/test/examples/source-repository/b/node_modules/@proteinjs/reflection/dist/src/FlattenedSourceGraph.d.ts +0 -19
- package/test/examples/source-repository/b/node_modules/@proteinjs/reflection/dist/src/FlattenedSourceGraph.js +0 -555
- package/test/examples/source-repository/b/node_modules/@proteinjs/reflection/dist/src/FlattenedSourceGraph.js.map +0 -1
- package/test/examples/source-repository/b/node_modules/@proteinjs/reflection/dist/src/Loadable.d.ts +0 -3
- package/test/examples/source-repository/b/node_modules/@proteinjs/reflection/dist/src/Loadable.js +0 -5
- package/test/examples/source-repository/b/node_modules/@proteinjs/reflection/dist/src/Loadable.js.map +0 -1
- package/test/examples/source-repository/b/node_modules/@proteinjs/reflection/dist/src/SourceRepository.d.ts +0 -45
- package/test/examples/source-repository/b/node_modules/@proteinjs/reflection/dist/src/SourceRepository.js +0 -176
- package/test/examples/source-repository/b/node_modules/@proteinjs/reflection/dist/src/SourceRepository.js.map +0 -1
- package/test/examples/source-repository/b/node_modules/@proteinjs/reflection/dist/src/SourceRepositoryFilter.d.ts +0 -11
- package/test/examples/source-repository/b/node_modules/@proteinjs/reflection/dist/src/SourceRepositoryFilter.js +0 -9
- package/test/examples/source-repository/b/node_modules/@proteinjs/reflection/dist/src/SourceRepositoryFilter.js.map +0 -1
- package/test/examples/source-repository/b/node_modules/@proteinjs/reflection/dist/src/sourceGraphTypes.d.ts +0 -13
- package/test/examples/source-repository/b/node_modules/@proteinjs/reflection/dist/src/sourceGraphTypes.js +0 -19
- package/test/examples/source-repository/b/node_modules/@proteinjs/reflection/dist/src/sourceGraphTypes.js.map +0 -1
- package/test/examples/source-repository/b/node_modules/@proteinjs/reflection/dist/src/types.d.ts +0 -221
- package/test/examples/source-repository/b/node_modules/@proteinjs/reflection/dist/src/types.js +0 -234
- package/test/examples/source-repository/b/node_modules/@proteinjs/reflection/dist/src/types.js.map +0 -1
- package/test/examples/source-repository/b/node_modules/@proteinjs/reflection/index.ts +0 -5
- package/test/examples/source-repository/b/node_modules/@proteinjs/reflection/jest.config.js +0 -9
- package/test/examples/source-repository/b/node_modules/@proteinjs/reflection/package.json +0 -42
- package/test/examples/source-repository/b/node_modules/@proteinjs/reflection/src/FlattenedSourceGraph.ts +0 -702
- package/test/examples/source-repository/b/node_modules/@proteinjs/reflection/src/Loadable.ts +0 -2
- package/test/examples/source-repository/b/node_modules/@proteinjs/reflection/src/SourceRepository.ts +0 -250
- package/test/examples/source-repository/b/node_modules/@proteinjs/reflection/src/SourceRepositoryFilter.ts +0 -15
- package/test/examples/source-repository/b/node_modules/@proteinjs/reflection/src/sourceGraphTypes.ts +0 -14
- package/test/examples/source-repository/b/node_modules/@proteinjs/reflection/src/types.ts +0 -236
- package/test/examples/source-repository/b/node_modules/@proteinjs/reflection/tsconfig.json +0 -19
- package/test/examples/source-repository/b/node_modules/@proteinjs/reflection/types/@dagrejs/graphlib.d.ts +0 -1
- package/test/examples/source-repository/b/node_modules/bindings/LICENSE.md +0 -22
- package/test/examples/source-repository/b/node_modules/bindings/README.md +0 -98
- package/test/examples/source-repository/b/node_modules/bindings/bindings.js +0 -221
- package/test/examples/source-repository/b/node_modules/bindings/package.json +0 -28
- package/test/examples/source-repository/b/node_modules/file-uri-to-path/.travis.yml +0 -30
- package/test/examples/source-repository/b/node_modules/file-uri-to-path/History.md +0 -21
- package/test/examples/source-repository/b/node_modules/file-uri-to-path/LICENSE +0 -20
- package/test/examples/source-repository/b/node_modules/file-uri-to-path/README.md +0 -74
- package/test/examples/source-repository/b/node_modules/file-uri-to-path/index.d.ts +0 -2
- package/test/examples/source-repository/b/node_modules/file-uri-to-path/index.js +0 -66
- package/test/examples/source-repository/b/node_modules/file-uri-to-path/package.json +0 -32
- package/test/examples/source-repository/b/node_modules/file-uri-to-path/test/test.js +0 -24
- package/test/examples/source-repository/b/node_modules/file-uri-to-path/test/tests.json +0 -13
- package/test/examples/source-repository/b/node_modules/fsevents/LICENSE +0 -22
- package/test/examples/source-repository/b/node_modules/fsevents/README.md +0 -89
- package/test/examples/source-repository/b/node_modules/fsevents/fsevents.d.ts +0 -46
- package/test/examples/source-repository/b/node_modules/fsevents/fsevents.js +0 -83
- package/test/examples/source-repository/b/node_modules/fsevents/fsevents.node +0 -0
- package/test/examples/source-repository/b/node_modules/fsevents/package.json +0 -62
- package/test/examples/source-repository/b/node_modules/glob-watcher/node_modules/fsevents/.travis.yml +0 -103
- package/test/examples/source-repository/b/node_modules/glob-watcher/node_modules/fsevents/ISSUE_TEMPLATE.md +0 -8
- package/test/examples/source-repository/b/node_modules/glob-watcher/node_modules/fsevents/LICENSE +0 -22
- package/test/examples/source-repository/b/node_modules/glob-watcher/node_modules/fsevents/Readme.md +0 -78
- package/test/examples/source-repository/b/node_modules/glob-watcher/node_modules/fsevents/binding.gyp +0 -21
- package/test/examples/source-repository/b/node_modules/glob-watcher/node_modules/fsevents/build/.target.mk +0 -53
- package/test/examples/source-repository/b/node_modules/glob-watcher/node_modules/fsevents/build/Makefile +0 -352
- package/test/examples/source-repository/b/node_modules/glob-watcher/node_modules/fsevents/build/Release/.deps/Release/.node.d +0 -1
- package/test/examples/source-repository/b/node_modules/glob-watcher/node_modules/fsevents/build/Release/.deps/Release/obj.target/fse/fsevents.o.d.raw +0 -75
- package/test/examples/source-repository/b/node_modules/glob-watcher/node_modules/fsevents/build/Release/.node +0 -0
- package/test/examples/source-repository/b/node_modules/glob-watcher/node_modules/fsevents/build/binding.Makefile +0 -6
- package/test/examples/source-repository/b/node_modules/glob-watcher/node_modules/fsevents/build/fse.target.mk +0 -188
- package/test/examples/source-repository/b/node_modules/glob-watcher/node_modules/fsevents/build/gyp-mac-tool +0 -772
- package/test/examples/source-repository/b/node_modules/glob-watcher/node_modules/fsevents/fsevents.cc +0 -88
- package/test/examples/source-repository/b/node_modules/glob-watcher/node_modules/fsevents/fsevents.js +0 -106
- package/test/examples/source-repository/b/node_modules/glob-watcher/node_modules/fsevents/install.js +0 -13
- package/test/examples/source-repository/b/node_modules/glob-watcher/node_modules/fsevents/package.json +0 -34
- package/test/examples/source-repository/b/node_modules/glob-watcher/node_modules/fsevents/src/async.cc +0 -43
- package/test/examples/source-repository/b/node_modules/glob-watcher/node_modules/fsevents/src/constants.cc +0 -110
- package/test/examples/source-repository/b/node_modules/glob-watcher/node_modules/fsevents/src/methods.cc +0 -44
- package/test/examples/source-repository/b/node_modules/glob-watcher/node_modules/fsevents/src/storage.cc +0 -27
- package/test/examples/source-repository/b/node_modules/glob-watcher/node_modules/fsevents/src/thread.cc +0 -71
- package/test/examples/source-repository/b/node_modules/nan/CHANGELOG.md +0 -557
- package/test/examples/source-repository/b/node_modules/nan/CMakeLists.txt +0 -138
- package/test/examples/source-repository/b/node_modules/nan/LICENSE.md +0 -9
- package/test/examples/source-repository/b/node_modules/nan/README.md +0 -456
- package/test/examples/source-repository/b/node_modules/nan/doc/asyncworker.md +0 -146
- package/test/examples/source-repository/b/node_modules/nan/doc/buffers.md +0 -54
- package/test/examples/source-repository/b/node_modules/nan/doc/callback.md +0 -76
- package/test/examples/source-repository/b/node_modules/nan/doc/converters.md +0 -41
- package/test/examples/source-repository/b/node_modules/nan/doc/errors.md +0 -226
- package/test/examples/source-repository/b/node_modules/nan/doc/json.md +0 -62
- package/test/examples/source-repository/b/node_modules/nan/doc/maybe_types.md +0 -583
- package/test/examples/source-repository/b/node_modules/nan/doc/methods.md +0 -672
- package/test/examples/source-repository/b/node_modules/nan/doc/new.md +0 -147
- package/test/examples/source-repository/b/node_modules/nan/doc/node_misc.md +0 -123
- package/test/examples/source-repository/b/node_modules/nan/doc/object_wrappers.md +0 -263
- package/test/examples/source-repository/b/node_modules/nan/doc/persistent.md +0 -296
- package/test/examples/source-repository/b/node_modules/nan/doc/scopes.md +0 -73
- package/test/examples/source-repository/b/node_modules/nan/doc/script.md +0 -58
- package/test/examples/source-repository/b/node_modules/nan/doc/string_bytes.md +0 -62
- package/test/examples/source-repository/b/node_modules/nan/doc/v8_internals.md +0 -199
- package/test/examples/source-repository/b/node_modules/nan/doc/v8_misc.md +0 -85
- package/test/examples/source-repository/b/node_modules/nan/include_dirs.js +0 -1
- package/test/examples/source-repository/b/node_modules/nan/nan.h +0 -2958
- package/test/examples/source-repository/b/node_modules/nan/nan_callbacks.h +0 -92
- package/test/examples/source-repository/b/node_modules/nan/nan_callbacks_12_inl.h +0 -520
- package/test/examples/source-repository/b/node_modules/nan/nan_callbacks_pre_12_inl.h +0 -520
- package/test/examples/source-repository/b/node_modules/nan/nan_converters.h +0 -72
- package/test/examples/source-repository/b/node_modules/nan/nan_converters_43_inl.h +0 -68
- package/test/examples/source-repository/b/node_modules/nan/nan_converters_pre_43_inl.h +0 -42
- package/test/examples/source-repository/b/node_modules/nan/nan_define_own_property_helper.h +0 -29
- package/test/examples/source-repository/b/node_modules/nan/nan_implementation_12_inl.h +0 -430
- package/test/examples/source-repository/b/node_modules/nan/nan_implementation_pre_12_inl.h +0 -263
- package/test/examples/source-repository/b/node_modules/nan/nan_json.h +0 -166
- package/test/examples/source-repository/b/node_modules/nan/nan_maybe_43_inl.h +0 -356
- package/test/examples/source-repository/b/node_modules/nan/nan_maybe_pre_43_inl.h +0 -268
- package/test/examples/source-repository/b/node_modules/nan/nan_new.h +0 -340
- package/test/examples/source-repository/b/node_modules/nan/nan_object_wrap.h +0 -156
- package/test/examples/source-repository/b/node_modules/nan/nan_persistent_12_inl.h +0 -132
- package/test/examples/source-repository/b/node_modules/nan/nan_persistent_pre_12_inl.h +0 -242
- package/test/examples/source-repository/b/node_modules/nan/nan_private.h +0 -73
- package/test/examples/source-repository/b/node_modules/nan/nan_scriptorigin.h +0 -76
- package/test/examples/source-repository/b/node_modules/nan/nan_string_bytes.h +0 -305
- package/test/examples/source-repository/b/node_modules/nan/nan_typedarray_contents.h +0 -96
- package/test/examples/source-repository/b/node_modules/nan/nan_weak.h +0 -437
- package/test/examples/source-repository/b/node_modules/nan/package.json +0 -38
- package/test/examples/source-repository/b/node_modules/nan/tools/1to2.js +0 -412
- package/test/examples/source-repository/b/node_modules/nan/tools/README.md +0 -14
- package/test/examples/source-repository/b/node_modules/nan/tools/package.json +0 -19
|
@@ -1,340 +0,0 @@
|
|
|
1
|
-
/*********************************************************************
|
|
2
|
-
* NAN - Native Abstractions for Node.js
|
|
3
|
-
*
|
|
4
|
-
* Copyright (c) 2018 NAN contributors
|
|
5
|
-
*
|
|
6
|
-
* MIT License <https://github.com/nodejs/nan/blob/master/LICENSE.md>
|
|
7
|
-
********************************************************************/
|
|
8
|
-
|
|
9
|
-
#ifndef NAN_NEW_H_
|
|
10
|
-
#define NAN_NEW_H_
|
|
11
|
-
|
|
12
|
-
namespace imp { // scnr
|
|
13
|
-
|
|
14
|
-
// TODO(agnat): Generalize
|
|
15
|
-
template <typename T> v8::Local<T> To(v8::Local<v8::Integer> i);
|
|
16
|
-
|
|
17
|
-
template <>
|
|
18
|
-
inline
|
|
19
|
-
v8::Local<v8::Integer>
|
|
20
|
-
To<v8::Integer>(v8::Local<v8::Integer> i) {
|
|
21
|
-
return Nan::To<v8::Integer>(i).ToLocalChecked();
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
template <>
|
|
25
|
-
inline
|
|
26
|
-
v8::Local<v8::Int32>
|
|
27
|
-
To<v8::Int32>(v8::Local<v8::Integer> i) {
|
|
28
|
-
return Nan::To<v8::Int32>(i).ToLocalChecked();
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
template <>
|
|
32
|
-
inline
|
|
33
|
-
v8::Local<v8::Uint32>
|
|
34
|
-
To<v8::Uint32>(v8::Local<v8::Integer> i) {
|
|
35
|
-
return Nan::To<v8::Uint32>(i).ToLocalChecked();
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
template <typename T> struct FactoryBase {
|
|
39
|
-
typedef v8::Local<T> return_t;
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
template <typename T> struct MaybeFactoryBase {
|
|
43
|
-
typedef MaybeLocal<T> return_t;
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
template <typename T> struct Factory;
|
|
47
|
-
|
|
48
|
-
template <>
|
|
49
|
-
struct Factory<v8::Array> : FactoryBase<v8::Array> {
|
|
50
|
-
static inline return_t New();
|
|
51
|
-
static inline return_t New(int length);
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
template <>
|
|
55
|
-
struct Factory<v8::Boolean> : FactoryBase<v8::Boolean> {
|
|
56
|
-
static inline return_t New(bool value);
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
template <>
|
|
60
|
-
struct Factory<v8::BooleanObject> : FactoryBase<v8::BooleanObject> {
|
|
61
|
-
static inline return_t New(bool value);
|
|
62
|
-
};
|
|
63
|
-
|
|
64
|
-
template <>
|
|
65
|
-
struct Factory<v8::Context> : FactoryBase<v8::Context> {
|
|
66
|
-
static inline
|
|
67
|
-
return_t
|
|
68
|
-
New( v8::ExtensionConfiguration* extensions = NULL
|
|
69
|
-
, v8::Local<v8::ObjectTemplate> tmpl = v8::Local<v8::ObjectTemplate>()
|
|
70
|
-
, v8::Local<v8::Value> obj = v8::Local<v8::Value>());
|
|
71
|
-
};
|
|
72
|
-
|
|
73
|
-
template <>
|
|
74
|
-
struct Factory<v8::Date> : MaybeFactoryBase<v8::Date> {
|
|
75
|
-
static inline return_t New(double value);
|
|
76
|
-
};
|
|
77
|
-
|
|
78
|
-
template <>
|
|
79
|
-
struct Factory<v8::External> : FactoryBase<v8::External> {
|
|
80
|
-
static inline return_t New(void *value);
|
|
81
|
-
};
|
|
82
|
-
|
|
83
|
-
template <>
|
|
84
|
-
struct Factory<v8::Function> : FactoryBase<v8::Function> {
|
|
85
|
-
static inline
|
|
86
|
-
return_t
|
|
87
|
-
New( FunctionCallback callback
|
|
88
|
-
, v8::Local<v8::Value> data = v8::Local<v8::Value>());
|
|
89
|
-
};
|
|
90
|
-
|
|
91
|
-
template <>
|
|
92
|
-
struct Factory<v8::FunctionTemplate> : FactoryBase<v8::FunctionTemplate> {
|
|
93
|
-
static inline
|
|
94
|
-
return_t
|
|
95
|
-
New( FunctionCallback callback = NULL
|
|
96
|
-
, v8::Local<v8::Value> data = v8::Local<v8::Value>()
|
|
97
|
-
, v8::Local<v8::Signature> signature = v8::Local<v8::Signature>());
|
|
98
|
-
};
|
|
99
|
-
|
|
100
|
-
template <>
|
|
101
|
-
struct Factory<v8::Number> : FactoryBase<v8::Number> {
|
|
102
|
-
static inline return_t New(double value);
|
|
103
|
-
};
|
|
104
|
-
|
|
105
|
-
template <>
|
|
106
|
-
struct Factory<v8::NumberObject> : FactoryBase<v8::NumberObject> {
|
|
107
|
-
static inline return_t New(double value);
|
|
108
|
-
};
|
|
109
|
-
|
|
110
|
-
template <typename T>
|
|
111
|
-
struct IntegerFactory : FactoryBase<T> {
|
|
112
|
-
typedef typename FactoryBase<T>::return_t return_t;
|
|
113
|
-
static inline return_t New(int32_t value);
|
|
114
|
-
static inline return_t New(uint32_t value);
|
|
115
|
-
};
|
|
116
|
-
|
|
117
|
-
template <>
|
|
118
|
-
struct Factory<v8::Integer> : IntegerFactory<v8::Integer> {};
|
|
119
|
-
|
|
120
|
-
template <>
|
|
121
|
-
struct Factory<v8::Int32> : IntegerFactory<v8::Int32> {};
|
|
122
|
-
|
|
123
|
-
template <>
|
|
124
|
-
struct Factory<v8::Uint32> : FactoryBase<v8::Uint32> {
|
|
125
|
-
static inline return_t New(int32_t value);
|
|
126
|
-
static inline return_t New(uint32_t value);
|
|
127
|
-
};
|
|
128
|
-
|
|
129
|
-
template <>
|
|
130
|
-
struct Factory<v8::Object> : FactoryBase<v8::Object> {
|
|
131
|
-
static inline return_t New();
|
|
132
|
-
};
|
|
133
|
-
|
|
134
|
-
template <>
|
|
135
|
-
struct Factory<v8::ObjectTemplate> : FactoryBase<v8::ObjectTemplate> {
|
|
136
|
-
static inline return_t New();
|
|
137
|
-
};
|
|
138
|
-
|
|
139
|
-
template <>
|
|
140
|
-
struct Factory<v8::RegExp> : MaybeFactoryBase<v8::RegExp> {
|
|
141
|
-
static inline return_t New(
|
|
142
|
-
v8::Local<v8::String> pattern, v8::RegExp::Flags flags);
|
|
143
|
-
};
|
|
144
|
-
|
|
145
|
-
template <>
|
|
146
|
-
struct Factory<v8::Script> : MaybeFactoryBase<v8::Script> {
|
|
147
|
-
static inline return_t New( v8::Local<v8::String> source);
|
|
148
|
-
static inline return_t New( v8::Local<v8::String> source
|
|
149
|
-
, v8::ScriptOrigin const& origin);
|
|
150
|
-
};
|
|
151
|
-
|
|
152
|
-
template <>
|
|
153
|
-
struct Factory<v8::Signature> : FactoryBase<v8::Signature> {
|
|
154
|
-
typedef v8::Local<v8::FunctionTemplate> FTH;
|
|
155
|
-
static inline return_t New(FTH receiver = FTH());
|
|
156
|
-
};
|
|
157
|
-
|
|
158
|
-
template <>
|
|
159
|
-
struct Factory<v8::String> : MaybeFactoryBase<v8::String> {
|
|
160
|
-
static inline return_t New();
|
|
161
|
-
static inline return_t New(const char *value, int length = -1);
|
|
162
|
-
static inline return_t New(const uint16_t *value, int length = -1);
|
|
163
|
-
static inline return_t New(std::string const& value);
|
|
164
|
-
|
|
165
|
-
static inline return_t New(v8::String::ExternalStringResource * value);
|
|
166
|
-
static inline return_t New(ExternalOneByteStringResource * value);
|
|
167
|
-
};
|
|
168
|
-
|
|
169
|
-
template <>
|
|
170
|
-
struct Factory<v8::StringObject> : FactoryBase<v8::StringObject> {
|
|
171
|
-
static inline return_t New(v8::Local<v8::String> value);
|
|
172
|
-
};
|
|
173
|
-
|
|
174
|
-
} // end of namespace imp
|
|
175
|
-
|
|
176
|
-
#if (NODE_MODULE_VERSION >= 12)
|
|
177
|
-
|
|
178
|
-
namespace imp {
|
|
179
|
-
|
|
180
|
-
template <>
|
|
181
|
-
struct Factory<v8::UnboundScript> : MaybeFactoryBase<v8::UnboundScript> {
|
|
182
|
-
static inline return_t New( v8::Local<v8::String> source);
|
|
183
|
-
static inline return_t New( v8::Local<v8::String> source
|
|
184
|
-
, v8::ScriptOrigin const& origin);
|
|
185
|
-
};
|
|
186
|
-
|
|
187
|
-
} // end of namespace imp
|
|
188
|
-
|
|
189
|
-
# include "nan_implementation_12_inl.h"
|
|
190
|
-
|
|
191
|
-
#else // NODE_MODULE_VERSION >= 12
|
|
192
|
-
|
|
193
|
-
# include "nan_implementation_pre_12_inl.h"
|
|
194
|
-
|
|
195
|
-
#endif
|
|
196
|
-
|
|
197
|
-
//=== API ======================================================================
|
|
198
|
-
|
|
199
|
-
template <typename T>
|
|
200
|
-
typename imp::Factory<T>::return_t
|
|
201
|
-
New() {
|
|
202
|
-
return imp::Factory<T>::New();
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
template <typename T, typename A0>
|
|
206
|
-
typename imp::Factory<T>::return_t
|
|
207
|
-
New(A0 arg0) {
|
|
208
|
-
return imp::Factory<T>::New(arg0);
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
template <typename T, typename A0, typename A1>
|
|
212
|
-
typename imp::Factory<T>::return_t
|
|
213
|
-
New(A0 arg0, A1 arg1) {
|
|
214
|
-
return imp::Factory<T>::New(arg0, arg1);
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
template <typename T, typename A0, typename A1, typename A2>
|
|
218
|
-
typename imp::Factory<T>::return_t
|
|
219
|
-
New(A0 arg0, A1 arg1, A2 arg2) {
|
|
220
|
-
return imp::Factory<T>::New(arg0, arg1, arg2);
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
template <typename T, typename A0, typename A1, typename A2, typename A3>
|
|
224
|
-
typename imp::Factory<T>::return_t
|
|
225
|
-
New(A0 arg0, A1 arg1, A2 arg2, A3 arg3) {
|
|
226
|
-
return imp::Factory<T>::New(arg0, arg1, arg2, arg3);
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
// Note(agnat): When passing overloaded function pointers to template functions
|
|
230
|
-
// as generic arguments the compiler needs help in picking the right overload.
|
|
231
|
-
// These two functions handle New<Function> and New<FunctionTemplate> with
|
|
232
|
-
// all argument variations.
|
|
233
|
-
|
|
234
|
-
// v8::Function and v8::FunctionTemplate with one or two arguments
|
|
235
|
-
template <typename T>
|
|
236
|
-
typename imp::Factory<T>::return_t
|
|
237
|
-
New( FunctionCallback callback
|
|
238
|
-
, v8::Local<v8::Value> data = v8::Local<v8::Value>()) {
|
|
239
|
-
return imp::Factory<T>::New(callback, data);
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
// v8::Function and v8::FunctionTemplate with three arguments
|
|
243
|
-
template <typename T, typename A2>
|
|
244
|
-
typename imp::Factory<T>::return_t
|
|
245
|
-
New( FunctionCallback callback
|
|
246
|
-
, v8::Local<v8::Value> data = v8::Local<v8::Value>()
|
|
247
|
-
, A2 a2 = A2()) {
|
|
248
|
-
return imp::Factory<T>::New(callback, data, a2);
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
// Convenience
|
|
252
|
-
|
|
253
|
-
#if NODE_MODULE_VERSION < IOJS_3_0_MODULE_VERSION
|
|
254
|
-
template <typename T> inline v8::Local<T> New(v8::Handle<T> h);
|
|
255
|
-
#endif
|
|
256
|
-
|
|
257
|
-
#if NODE_MODULE_VERSION > NODE_0_10_MODULE_VERSION
|
|
258
|
-
template <typename T, typename M>
|
|
259
|
-
inline v8::Local<T> New(v8::Persistent<T, M> const& p);
|
|
260
|
-
#else
|
|
261
|
-
template <typename T> inline v8::Local<T> New(v8::Persistent<T> const& p);
|
|
262
|
-
#endif
|
|
263
|
-
template <typename T, typename M>
|
|
264
|
-
inline v8::Local<T> New(Persistent<T, M> const& p);
|
|
265
|
-
template <typename T>
|
|
266
|
-
inline v8::Local<T> New(Global<T> const& p);
|
|
267
|
-
|
|
268
|
-
inline
|
|
269
|
-
imp::Factory<v8::Boolean>::return_t
|
|
270
|
-
New(bool value) {
|
|
271
|
-
return New<v8::Boolean>(value);
|
|
272
|
-
}
|
|
273
|
-
|
|
274
|
-
inline
|
|
275
|
-
imp::Factory<v8::Int32>::return_t
|
|
276
|
-
New(int32_t value) {
|
|
277
|
-
return New<v8::Int32>(value);
|
|
278
|
-
}
|
|
279
|
-
|
|
280
|
-
inline
|
|
281
|
-
imp::Factory<v8::Uint32>::return_t
|
|
282
|
-
New(uint32_t value) {
|
|
283
|
-
return New<v8::Uint32>(value);
|
|
284
|
-
}
|
|
285
|
-
|
|
286
|
-
inline
|
|
287
|
-
imp::Factory<v8::Number>::return_t
|
|
288
|
-
New(double value) {
|
|
289
|
-
return New<v8::Number>(value);
|
|
290
|
-
}
|
|
291
|
-
|
|
292
|
-
inline
|
|
293
|
-
imp::Factory<v8::String>::return_t
|
|
294
|
-
New(std::string const& value) { // NOLINT(build/include_what_you_use)
|
|
295
|
-
return New<v8::String>(value);
|
|
296
|
-
}
|
|
297
|
-
|
|
298
|
-
inline
|
|
299
|
-
imp::Factory<v8::String>::return_t
|
|
300
|
-
New(const char * value, int length) {
|
|
301
|
-
return New<v8::String>(value, length);
|
|
302
|
-
}
|
|
303
|
-
|
|
304
|
-
inline
|
|
305
|
-
imp::Factory<v8::String>::return_t
|
|
306
|
-
New(const uint16_t * value, int length) {
|
|
307
|
-
return New<v8::String>(value, length);
|
|
308
|
-
}
|
|
309
|
-
|
|
310
|
-
inline
|
|
311
|
-
imp::Factory<v8::String>::return_t
|
|
312
|
-
New(const char * value) {
|
|
313
|
-
return New<v8::String>(value);
|
|
314
|
-
}
|
|
315
|
-
|
|
316
|
-
inline
|
|
317
|
-
imp::Factory<v8::String>::return_t
|
|
318
|
-
New(const uint16_t * value) {
|
|
319
|
-
return New<v8::String>(value);
|
|
320
|
-
}
|
|
321
|
-
|
|
322
|
-
inline
|
|
323
|
-
imp::Factory<v8::String>::return_t
|
|
324
|
-
New(v8::String::ExternalStringResource * value) {
|
|
325
|
-
return New<v8::String>(value);
|
|
326
|
-
}
|
|
327
|
-
|
|
328
|
-
inline
|
|
329
|
-
imp::Factory<v8::String>::return_t
|
|
330
|
-
New(ExternalOneByteStringResource * value) {
|
|
331
|
-
return New<v8::String>(value);
|
|
332
|
-
}
|
|
333
|
-
|
|
334
|
-
inline
|
|
335
|
-
imp::Factory<v8::RegExp>::return_t
|
|
336
|
-
New(v8::Local<v8::String> pattern, v8::RegExp::Flags flags) {
|
|
337
|
-
return New<v8::RegExp>(pattern, flags);
|
|
338
|
-
}
|
|
339
|
-
|
|
340
|
-
#endif // NAN_NEW_H_
|
|
@@ -1,156 +0,0 @@
|
|
|
1
|
-
/*********************************************************************
|
|
2
|
-
* NAN - Native Abstractions for Node.js
|
|
3
|
-
*
|
|
4
|
-
* Copyright (c) 2018 NAN contributors
|
|
5
|
-
*
|
|
6
|
-
* MIT License <https://github.com/nodejs/nan/blob/master/LICENSE.md>
|
|
7
|
-
********************************************************************/
|
|
8
|
-
|
|
9
|
-
#ifndef NAN_OBJECT_WRAP_H_
|
|
10
|
-
#define NAN_OBJECT_WRAP_H_
|
|
11
|
-
|
|
12
|
-
class ObjectWrap {
|
|
13
|
-
public:
|
|
14
|
-
ObjectWrap() {
|
|
15
|
-
refs_ = 0;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
virtual ~ObjectWrap() {
|
|
20
|
-
if (persistent().IsEmpty()) {
|
|
21
|
-
return;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
persistent().ClearWeak();
|
|
25
|
-
persistent().Reset();
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
template <class T>
|
|
30
|
-
static inline T* Unwrap(v8::Local<v8::Object> object) {
|
|
31
|
-
assert(!object.IsEmpty());
|
|
32
|
-
assert(object->InternalFieldCount() > 0);
|
|
33
|
-
// Cast to ObjectWrap before casting to T. A direct cast from void
|
|
34
|
-
// to T won't work right when T has more than one base class.
|
|
35
|
-
void* ptr = GetInternalFieldPointer(object, 0);
|
|
36
|
-
ObjectWrap* wrap = static_cast<ObjectWrap*>(ptr);
|
|
37
|
-
return static_cast<T*>(wrap);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
inline v8::Local<v8::Object> handle() const {
|
|
42
|
-
return New(handle_);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
inline Persistent<v8::Object>& persistent() {
|
|
47
|
-
return handle_;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
protected:
|
|
52
|
-
inline void Wrap(v8::Local<v8::Object> object) {
|
|
53
|
-
assert(persistent().IsEmpty());
|
|
54
|
-
assert(object->InternalFieldCount() > 0);
|
|
55
|
-
SetInternalFieldPointer(object, 0, this);
|
|
56
|
-
persistent().Reset(object);
|
|
57
|
-
MakeWeak();
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
#if defined(V8_MAJOR_VERSION) && (V8_MAJOR_VERSION > 4 || \
|
|
61
|
-
(V8_MAJOR_VERSION == 4 && defined(V8_MINOR_VERSION) && V8_MINOR_VERSION >= 3))
|
|
62
|
-
|
|
63
|
-
inline void MakeWeak() {
|
|
64
|
-
persistent().v8::PersistentBase<v8::Object>::SetWeak(
|
|
65
|
-
this, WeakCallback, v8::WeakCallbackType::kParameter);
|
|
66
|
-
#if NODE_MAJOR_VERSION < 10
|
|
67
|
-
// FIXME(bnoordhuis) Probably superfluous in older Node.js versions too.
|
|
68
|
-
persistent().MarkIndependent();
|
|
69
|
-
#endif
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
#elif NODE_MODULE_VERSION > NODE_0_10_MODULE_VERSION
|
|
73
|
-
|
|
74
|
-
inline void MakeWeak() {
|
|
75
|
-
persistent().v8::PersistentBase<v8::Object>::SetWeak(this, WeakCallback);
|
|
76
|
-
persistent().MarkIndependent();
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
#else
|
|
80
|
-
|
|
81
|
-
inline void MakeWeak() {
|
|
82
|
-
persistent().persistent.MakeWeak(this, WeakCallback);
|
|
83
|
-
persistent().MarkIndependent();
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
#endif
|
|
87
|
-
|
|
88
|
-
/* Ref() marks the object as being attached to an event loop.
|
|
89
|
-
* Refed objects will not be garbage collected, even if
|
|
90
|
-
* all references are lost.
|
|
91
|
-
*/
|
|
92
|
-
virtual void Ref() {
|
|
93
|
-
assert(!persistent().IsEmpty());
|
|
94
|
-
persistent().ClearWeak();
|
|
95
|
-
refs_++;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
/* Unref() marks an object as detached from the event loop. This is its
|
|
99
|
-
* default state. When an object with a "weak" reference changes from
|
|
100
|
-
* attached to detached state it will be freed. Be careful not to access
|
|
101
|
-
* the object after making this call as it might be gone!
|
|
102
|
-
* (A "weak reference" means an object that only has a
|
|
103
|
-
* persistent handle.)
|
|
104
|
-
*
|
|
105
|
-
* DO NOT CALL THIS FROM DESTRUCTOR
|
|
106
|
-
*/
|
|
107
|
-
virtual void Unref() {
|
|
108
|
-
assert(!persistent().IsEmpty());
|
|
109
|
-
assert(!persistent().IsWeak());
|
|
110
|
-
assert(refs_ > 0);
|
|
111
|
-
if (--refs_ == 0)
|
|
112
|
-
MakeWeak();
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
int refs_; // ro
|
|
116
|
-
|
|
117
|
-
private:
|
|
118
|
-
NAN_DISALLOW_ASSIGN_COPY_MOVE(ObjectWrap)
|
|
119
|
-
#if defined(V8_MAJOR_VERSION) && (V8_MAJOR_VERSION > 4 || \
|
|
120
|
-
(V8_MAJOR_VERSION == 4 && defined(V8_MINOR_VERSION) && V8_MINOR_VERSION >= 3))
|
|
121
|
-
|
|
122
|
-
static void
|
|
123
|
-
WeakCallback(v8::WeakCallbackInfo<ObjectWrap> const& info) {
|
|
124
|
-
ObjectWrap* wrap = info.GetParameter();
|
|
125
|
-
assert(wrap->refs_ == 0);
|
|
126
|
-
wrap->handle_.Reset();
|
|
127
|
-
delete wrap;
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
#elif NODE_MODULE_VERSION > NODE_0_10_MODULE_VERSION
|
|
131
|
-
|
|
132
|
-
static void
|
|
133
|
-
WeakCallback(v8::WeakCallbackData<v8::Object, ObjectWrap> const& data) {
|
|
134
|
-
ObjectWrap* wrap = data.GetParameter();
|
|
135
|
-
assert(wrap->refs_ == 0);
|
|
136
|
-
assert(wrap->handle_.IsNearDeath());
|
|
137
|
-
wrap->handle_.Reset();
|
|
138
|
-
delete wrap;
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
#else
|
|
142
|
-
|
|
143
|
-
static void WeakCallback(v8::Persistent<v8::Value> value, void *data) {
|
|
144
|
-
ObjectWrap *wrap = static_cast<ObjectWrap*>(data);
|
|
145
|
-
assert(wrap->refs_ == 0);
|
|
146
|
-
assert(wrap->handle_.IsNearDeath());
|
|
147
|
-
wrap->handle_.Reset();
|
|
148
|
-
delete wrap;
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
#endif
|
|
152
|
-
Persistent<v8::Object> handle_;
|
|
153
|
-
};
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
#endif // NAN_OBJECT_WRAP_H_
|
|
@@ -1,132 +0,0 @@
|
|
|
1
|
-
/*********************************************************************
|
|
2
|
-
* NAN - Native Abstractions for Node.js
|
|
3
|
-
*
|
|
4
|
-
* Copyright (c) 2018 NAN contributors
|
|
5
|
-
*
|
|
6
|
-
* MIT License <https://github.com/nodejs/nan/blob/master/LICENSE.md>
|
|
7
|
-
********************************************************************/
|
|
8
|
-
|
|
9
|
-
#ifndef NAN_PERSISTENT_12_INL_H_
|
|
10
|
-
#define NAN_PERSISTENT_12_INL_H_
|
|
11
|
-
|
|
12
|
-
template<typename T, typename M> class Persistent :
|
|
13
|
-
public v8::Persistent<T, M> {
|
|
14
|
-
public:
|
|
15
|
-
inline Persistent() : v8::Persistent<T, M>() {}
|
|
16
|
-
|
|
17
|
-
template<typename S> inline Persistent(v8::Local<S> that) :
|
|
18
|
-
v8::Persistent<T, M>(v8::Isolate::GetCurrent(), that) {}
|
|
19
|
-
|
|
20
|
-
template<typename S, typename M2>
|
|
21
|
-
inline
|
|
22
|
-
Persistent(const v8::Persistent<S, M2> &that) : // NOLINT(runtime/explicit)
|
|
23
|
-
v8::Persistent<T, M2>(v8::Isolate::GetCurrent(), that) {}
|
|
24
|
-
|
|
25
|
-
inline void Reset() { v8::PersistentBase<T>::Reset(); }
|
|
26
|
-
|
|
27
|
-
template <typename S>
|
|
28
|
-
inline void Reset(const v8::Local<S> &other) {
|
|
29
|
-
v8::PersistentBase<T>::Reset(v8::Isolate::GetCurrent(), other);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
template <typename S>
|
|
33
|
-
inline void Reset(const v8::PersistentBase<S> &other) {
|
|
34
|
-
v8::PersistentBase<T>::Reset(v8::Isolate::GetCurrent(), other);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
template<typename P>
|
|
38
|
-
inline void SetWeak(
|
|
39
|
-
P *parameter
|
|
40
|
-
, typename WeakCallbackInfo<P>::Callback callback
|
|
41
|
-
, WeakCallbackType type);
|
|
42
|
-
|
|
43
|
-
private:
|
|
44
|
-
inline T *operator*() const { return *PersistentBase<T>::persistent; }
|
|
45
|
-
|
|
46
|
-
template<typename S, typename M2>
|
|
47
|
-
inline void Copy(const Persistent<S, M2> &that) {
|
|
48
|
-
TYPE_CHECK(T, S);
|
|
49
|
-
|
|
50
|
-
this->Reset();
|
|
51
|
-
|
|
52
|
-
if (!that.IsEmpty()) {
|
|
53
|
-
this->Reset(that);
|
|
54
|
-
M::Copy(that, this);
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
#if defined(V8_MAJOR_VERSION) && (V8_MAJOR_VERSION > 4 || \
|
|
60
|
-
(V8_MAJOR_VERSION == 4 && defined(V8_MINOR_VERSION) && V8_MINOR_VERSION >= 3))
|
|
61
|
-
template<typename T>
|
|
62
|
-
class Global : public v8::Global<T> {
|
|
63
|
-
public:
|
|
64
|
-
inline Global() : v8::Global<T>() {}
|
|
65
|
-
|
|
66
|
-
template<typename S> inline Global(v8::Local<S> that) :
|
|
67
|
-
v8::Global<T>(v8::Isolate::GetCurrent(), that) {}
|
|
68
|
-
|
|
69
|
-
template<typename S>
|
|
70
|
-
inline
|
|
71
|
-
Global(const v8::PersistentBase<S> &that) : // NOLINT(runtime/explicit)
|
|
72
|
-
v8::Global<S>(v8::Isolate::GetCurrent(), that) {}
|
|
73
|
-
|
|
74
|
-
inline void Reset() { v8::PersistentBase<T>::Reset(); }
|
|
75
|
-
|
|
76
|
-
template <typename S>
|
|
77
|
-
inline void Reset(const v8::Local<S> &other) {
|
|
78
|
-
v8::PersistentBase<T>::Reset(v8::Isolate::GetCurrent(), other);
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
template <typename S>
|
|
82
|
-
inline void Reset(const v8::PersistentBase<S> &other) {
|
|
83
|
-
v8::PersistentBase<T>::Reset(v8::Isolate::GetCurrent(), other);
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
template<typename P>
|
|
87
|
-
inline void SetWeak(
|
|
88
|
-
P *parameter
|
|
89
|
-
, typename WeakCallbackInfo<P>::Callback callback
|
|
90
|
-
, WeakCallbackType type) {
|
|
91
|
-
reinterpret_cast<Persistent<T>*>(this)->SetWeak(
|
|
92
|
-
parameter, callback, type);
|
|
93
|
-
}
|
|
94
|
-
};
|
|
95
|
-
#else
|
|
96
|
-
template<typename T>
|
|
97
|
-
class Global : public v8::UniquePersistent<T> {
|
|
98
|
-
public:
|
|
99
|
-
inline Global() : v8::UniquePersistent<T>() {}
|
|
100
|
-
|
|
101
|
-
template<typename S> inline Global(v8::Local<S> that) :
|
|
102
|
-
v8::UniquePersistent<T>(v8::Isolate::GetCurrent(), that) {}
|
|
103
|
-
|
|
104
|
-
template<typename S>
|
|
105
|
-
inline
|
|
106
|
-
Global(const v8::PersistentBase<S> &that) : // NOLINT(runtime/explicit)
|
|
107
|
-
v8::UniquePersistent<S>(v8::Isolate::GetCurrent(), that) {}
|
|
108
|
-
|
|
109
|
-
inline void Reset() { v8::PersistentBase<T>::Reset(); }
|
|
110
|
-
|
|
111
|
-
template <typename S>
|
|
112
|
-
inline void Reset(const v8::Local<S> &other) {
|
|
113
|
-
v8::PersistentBase<T>::Reset(v8::Isolate::GetCurrent(), other);
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
template <typename S>
|
|
117
|
-
inline void Reset(const v8::PersistentBase<S> &other) {
|
|
118
|
-
v8::PersistentBase<T>::Reset(v8::Isolate::GetCurrent(), other);
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
template<typename P>
|
|
122
|
-
inline void SetWeak(
|
|
123
|
-
P *parameter
|
|
124
|
-
, typename WeakCallbackInfo<P>::Callback callback
|
|
125
|
-
, WeakCallbackType type) {
|
|
126
|
-
reinterpret_cast<Persistent<T>*>(this)->SetWeak(
|
|
127
|
-
parameter, callback, type);
|
|
128
|
-
}
|
|
129
|
-
};
|
|
130
|
-
#endif
|
|
131
|
-
|
|
132
|
-
#endif // NAN_PERSISTENT_12_INL_H_
|