This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://jsfiddle.net/vk35ok2o/50/ | |
console.log('typeof 1/0 => ', typeof 1/0); | |
console.log('typeof (1/0) => ', typeof (1/0)); | |
console.log('1/0 => ', 1/0); | |
console.log('"Hello" * 2 => ', "Hello" * 2); | |
console.log('typeof ("Hello" * 2) => ', typeof ("Hello" * 2)); | |
console.log('typeof "Hello" * 2 => ', typeof "Hello" * 2); | |
console.log('typeof undefined => ', typeof undefined); | |
console.log('typeof null => ', typeof null); | |
console.log('typeof function(){} => ', typeof function(){}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const DIRECTIVE_TO_COMPONENT = { | |
scope: "bindings" | |
}; | |
const DEPRECATED_PROPS = ["restrict", "replace", "bindToController"]; | |
const DIRECTIVE_UNIQUE_PROPS = ["link", "compile", "multiElement", "priority", "templateNamespace", "terminal"]; | |
function transform(j, path) { | |
const directiveDeclaration = path.value.arguments[1]; | |
const directiveProperties = directiveDeclaration.body.body[0].argument.properties; | |
const newProps = directiveProperties.filter(prop => !DEPRECATED_PROPS.includes(prop.key.name)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function isOnTheBody(path) { | |
return path.scope.parent.isGlobal; | |
} | |
function transform(j, path) { | |
const propName = path.value.id.name; | |
const params = path.value.params; | |
const body = path.value.body; | |
j(path).replaceWith( |