@samitouri / QOS-React / commits / a1645322a7

Lint issues

Most dead code

Sebastian Markbage committed Nov 16, 2016 at 15:36 UTC a1645322a7cca3d28b8fcfad533240526f051c24
1 file changed +11 -24
src/renderers/dom/fiber/ReactDOMFiberComponent.js
+11 -24
@@ -29,13 +29,11 @@ var ReactDOMFiberSelect = require('ReactDOMFiberSelect');
29 var ReactDOMFiberTextarea = require('ReactDOMFiberTextarea');
30
31 var emptyFunction = require('emptyFunction');
32 -var escapeTextContentForBrowser = require('escapeTextContentForBrowser');
32 var focusNode = require('focusNode');
33 var invariant = require('invariant');
34 var isEventSupported = require('isEventSupported');
35 var setInnerHTML = require('setInnerHTML');
36 var setTextContent = require('setTextContent');
38 -var shallowEqual = require('shallowEqual');
37 var inputValueTracking = require('inputValueTracking');
38 var warning = require('warning');
39 var didWarnShadyDOM = false;
@@ -44,9 +42,6 @@ var getNode = ReactDOMComponentTree.getNodeFromInstance;
42 var listenTo = ReactBrowserEventEmitter.listenTo;
43 var registrationNameModules = EventPluginRegistry.registrationNameModules;
44
47 -// For quickly matching children type, to test if can be treated as content.
48 -var CONTENT_TYPES = {'string': true, 'number': true};
49 -
45 var DANGEROUSLY_SET_INNER_HTML = 'dangerouslySetInnerHTML';
46 var SUPPRESS_CONTENT_EDITABLE_WARNING = 'suppressContentEditableWarning';
47 var CHILDREN = 'children';
@@ -286,18 +281,12 @@ var omittedCloseTags = {
281 // NOTE: menuitem's close tag should be omitted, but that causes problems.
282 };
283
289 -var newlineEatingTags = {
290 - 'listing': true,
291 - 'pre': true,
292 - 'textarea': true,
293 -};
294 -
284 // For HTML, certain tags cannot have children. This has the same purpose as
285 // `omittedCloseTags` except that `menuitem` should still have its closing tag.
286
287 var voidElementTags = {
288 'menuitem': true,
300 - ...omittedCloseTags
289 + ...omittedCloseTags,
290 };
291
292 // We accept any tag to be rendered but since this gets injected into arbitrary
@@ -412,20 +401,19 @@ function updateDOMProperties(
401 styleUpdates = nextProp;
402 }
403 } else if (propKey === DANGEROUSLY_SET_INNER_HTML) {
415 - if (lastProp && nextProp) {
416 - var lastHtml = lastProp[HTML];
417 - var nextHtml = nextProp[HTML];
418 - if (lastHtml !== nextHtml) {
419 - if (nextHtml == null) {
420 - // TODO: It might be too late to clear this if we have children
421 - // inserted already.
422 - } else {
404 + var nextHtml = nextProp ? nextProp[HTML] : undefined;
405 + var lastHtml = lastProp ? lastProp[HTML] : undefined;
406 + if (nextHtml) {
407 + if (lastHtml) {
408 + if (lastHtml !== nextHtml) {
409 setInnerHTML(getNode(workInProgress), '' + nextHtml);
410 }
411 + } else {
412 + setInnerHTML(getNode(workInProgress), nextHtml);
413 }
426 - } else if (nextProp) {
427 - var nextHtml = nextProp[HTML];
428 - setInnerHTML(getNode(workInProgress), nextProp);
414 + } else {
415 + // TODO: It might be too late to clear this if we have children
416 + // inserted already.
417 }
418 } else if (propKey === CHILDREN) {
419 if (typeof nextProp === 'string') {
@@ -555,7 +543,6 @@ var ReactDOMFiberComponent = {
543 }
544 workInProgress._namespaceURI = namespaceURI;
545
558 - var mountImage;
546 var type = workInProgress._currentElement.type;
547 var ownerDocument = hostContainerInfo._ownerDocument;
548 var el;