fix: use "logger" instead of console.error

... to be graceful with older browser without "console"
This commit is contained in:
Nils Knappmeier
2020-01-10 17:05:23 +01:00
parent 7af1c12db6
commit 575d8772e2
+3 -2
View File
@@ -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);
@@ -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`