Skip to content

Renaming causes bug to occur on iOS device #3164

Closed
@leidegre

Description

@leidegre

The following JavaScript

"use strict";
const selectors_1 = require("../../../shared/selectors");
module.exports = async (dispatch, getState, { match, serverRes, appContext }) => {
    const { fetchProjectDetails } = await appContext.import('../actions', __filename, __dirname);
    await dispatch(fetchProjectDetails(match.params.projectHId));
    if (typeof process !== 'undefined') {
        if (selectors_1.getRequestErrorCode(getState(), { operationId: `/projects/${match.params.projectHId}` }) === 'NOT_FOUND') {
            serverRes && serverRes.status(404);
        }
    }
};

Compiled like this

java -jar closure-compiler-v20181125.jar --language_in ECMASCRIPT_2017 --language_out ECMASCRIPT_2017 --js x.js --formatting PRETTY_PRINT

Results in the following code

'use strict';
const selectors_1 = require("../../../shared/selectors");
module.exports = async(d, e, {match:b, serverRes:c, appContext:a}) => {
  var {fetchProjectDetails:a} = await a.import("../actions", __filename, __dirname);
  await d(a(b.params.projectHId));
  "undefined" !== typeof process && "NOT_FOUND" === selectors_1.getRequestErrorCode(e(), {operationId:`/projects/${b.params.projectHId}`}) && c && c.status(404);
};

This line

var {fetchProjectDetails:a} = await a.import("../actions", __filename, __dirname);

Both appContext and fetchProjectDetails was renamed to a which appears to confuse iOS. The error we get is undefined is not an object (evaluating 'a.import'). This is a consistent issue across all iOS devices we've been able to test with and I'm wondering whether there's a way to get around this issue without switching to WHITESPACE_ONLY.

Metadata

Metadata

Assignees

Labels

internal-issue-createdAn internal Google issue has been created to track this GitHub issuetriage-doneHas been reviewed by someone on triage rotation.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions