Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple let declaration with es6 #786

Closed
fathyb opened this issue May 6, 2017 · 0 comments
Closed

Multiple let declaration with es6 #786

fathyb opened this issue May 6, 2017 · 0 comments

Comments

@fathyb
Copy link

fathyb commented May 6, 2017

protobuf.js version: 6.7.3

The verify method of messages with multiple messages field gets multiple es6 block-scoped let error declarations.

This causes Uncaught SyntaxError: Identifier 'error' has already been declared on v8.

/**
 * Verifies a Shadow message.
 * @param {Object.<string,*>} message Plain object to verify
 * @returns {?string} `null` if valid, otherwise the reason why it is not
 */
Shadow.verify = function verify(message) {
    if (typeof message !== "object" || message === null)
        return "object expected";
    let error = $root.Color.verify(message.color);
    if (error)
        return "color." + error;
    if (typeof message.blur !== "number")
        return "blur: number expected";
    let error = $root.Point.verify(message.offset);
    if (error)
        return "offset." + error;
    return null;
};
message Shadow {
    required Color color = 1;
    required double blur = 2;
    required Point offset = 3;
}
@dcodeIO dcodeIO closed this as completed in f295979 Jun 9, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant