Skip to content

Commit

Permalink
fix: use "logger" instead of console.error
Browse files Browse the repository at this point in the history
... to be graceful with older browser without "console"
  • Loading branch information
nknapp committed Jan 10, 2020
1 parent 7af1c12 commit 575d877
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/handlebars/internal/proto-access.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { createNewLookupObject } from './create-new-lookup-object';
import * as logger from '../logger';

export function createProtoAccessControl(runtimeOptions) {
let defaultMethodWhiteList = Object.create(null);
Expand Down Expand Up @@ -44,9 +45,9 @@ function checkWhiteList(protoAccessControlForType, propertyName) {
if (protoAccessControlForType.defaultValue !== undefined) {
return protoAccessControlForType.defaultValue;
}

// eslint-disable-next-line no-console
console.error(
logger.log(
'error',
`Handlebars: Access has been denied to resolve the property "${propertyName}" because it is not an "own property" of its parent.\n` +
`You can add a runtime option to disable the check or this warning:\n` +
`See http://localhost:8080/api-reference/runtime-options.html#options-to-control-prototype-access for details`
Expand Down

0 comments on commit 575d877

Please sign in to comment.