Skip to content

Commit

Permalink
Merge pull request #139 from appoptics/ao-18716-fix-node14-warning
Browse files Browse the repository at this point in the history
AO-18716 fix node 14 non-existent property warning
  • Loading branch information
cheempz authored Feb 11, 2021
2 parents 2a8e528 + 18c4255 commit 051453a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
7 changes: 5 additions & 2 deletions lib/api-sim.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@ let cls;
module.exports = function (appoptics) {
ao = appoptics;
aob = ao.addon;
cls = ao.cls;
// check for property to avoid triggering node 14 warning on
// non-existent property in unfinished module.exports
if (ao.hasOwnProperty('cls')) {
cls = ao.cls;
}

// define the properties (some of which are part of the API)
definePropertiesOn(ao);
Expand Down Expand Up @@ -760,4 +764,3 @@ function insertLogObject (o = {}) {
function wrapLambdaHandler (fn) {
return fn;
}

4 changes: 3 additions & 1 deletion lib/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ module.exports = function (appoptics) {
ao.maps.responseFinalizers = responseFinalizers;

// each invocation in lambda is counted
if (ao.lambda) {
// use property check that does not trigger node 14 warning on
// non-existent property in unfinished module.exports
if (ao.hasOwnProperty('lambda')) {
ao.lambda.invocations = 0;
}

Expand Down

0 comments on commit 051453a

Please sign in to comment.