Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fixed error: ‘class v8::Object’ has no member named ‘CreationCon… #44

Merged
merged 17 commits into from
Jan 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
a9eef89
fix: fixed error: ‘class v8::Object’ has no member named ‘CreationCon…
zack09holland Aug 9, 2023
d94cd78
feat: add node v16 and v20 to github actions matrix
zack09holland Jan 21, 2024
a3b2acf
fix: updated workflow script to run on push and pull request events
zack09holland Jan 21, 2024
36bea99
fix: updated actions/checkout@v2 to v3 as the former was deprecated
zack09holland Jan 21, 2024
c6fc128
test: trying to get the bindings file made/located correctly
zack09holland Jan 21, 2024
8e4d2f9
fix: removed incorrect cd step
zack09holland Jan 21, 2024
2fcbc7c
feat: added fail-fast so jobs will continue running after a node vers…
zack09holland Jan 21, 2024
4c0057d
feat/test: set the context depending on the node version; node v16+ u…
zack09holland Jan 21, 2024
f4255b3
fix/test: added node version header to expand.cc and parser.cc
zack09holland Jan 21, 2024
ccf6e3d
test: changed node_version header to node header
zack09holland Jan 21, 2024
a05e2e1
fix: reverting back to state where node 16,18,20 tests worked...
zack09holland Jan 21, 2024
1b058f9
fix/test: reverted github actions to v2 from v3...
zack09holland Jan 21, 2024
90a5001
test: attempt to get tests to pass for node v16+
zack09holland Jan 21, 2024
44dd8c7
Merge branch 'master' of github.com:zack09holland/node-postal
zack09holland Jan 21, 2024
7b1cb90
fix: re-added line in ParseAddress that had been incorrectly removed
zack09holland Jan 22, 2024
733a383
fix: depending on node version call the right context function
zack09holland Jan 22, 2024
7dbdfe1
fix: removed typo
zack09holland Jan 22, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
name: 'Continuous Integration'
on: push
on: [push, pull_request]
jobs:
unit-tests:
runs-on: '${{ matrix.os }}'
continue-on-error: ${{ matrix.status != 'current' }}
strategy:
fail-fast: false
matrix:
status: ['current']
os:
Expand All @@ -13,6 +14,8 @@ jobs:
- 12.x
- 14.x
- 16.x
- 18.x
- 20.x
include:
- os: ubuntu-20.04
node-version: 8.x
Expand All @@ -26,7 +29,7 @@ jobs:
shell: bash
run: |
sudo apt-get update
sudo apt-get install curl autoconf automake libtool pkg-config
sudo apt-get install build-essential curl autoconf automake libtool pkg-config
- name: 'Create working directories'
shell: bash
run: |
Expand Down
9 changes: 7 additions & 2 deletions src/expand.cc
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,13 @@ static void cleanup(void*) {
}

void init(v8::Local<v8::Object> exports) {
v8::Local<v8::Context> context = exports->CreationContext();

// Check Node.js version
#if NODE_MAJOR_VERSION >= 16
v8::Local<v8::Context> context = exports->GetCreationContext().ToLocalChecked();
#else
v8::Local<v8::Context> context = exports->CreationContext();
#endif

if (!libpostal_setup() || !libpostal_setup_language_classifier()) {
Nan::ThrowError("Could not load libpostal");
return;
Expand Down
7 changes: 6 additions & 1 deletion src/parser.cc
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,12 @@ static void cleanup(void*) {
}

void init(v8::Local<v8::Object> exports) {
v8::Local<v8::Context> context = exports->CreationContext();
// Check Node.js version
#if NODE_MAJOR_VERSION >= 16
v8::Local<v8::Context> context = exports->GetCreationContext().ToLocalChecked();
#else
v8::Local<v8::Context> context = exports->CreationContext();
#endif

if (!libpostal_setup() || !libpostal_setup_parser()) {
Nan::ThrowError("Could not load libpostal");
Expand Down
Loading