Code Monkey home page Code Monkey logo

Comments (2)

osa1 avatar osa1 commented on May 18, 2024

Currently the _isReadOnly getter is private. We should make it public

We now have a getter for _isReadOnly:

/// Returns `true` if this message is marked read-only. Otherwise `false`.
///
/// Even when `false`, some sub-message could be read-only.
///
/// If `true` all sub-messages are frozen.
bool get isFrozen => _fieldSet._isReadOnly;

I don't understand the story with mixins enough to comment on whether the problem with not enforcing read-only behavior in mixins still exist..

EDIT: Just learned that PbMapMixin is to provide a map-like interface for messages.

from protobuf.dart.

skybrian avatar skybrian commented on May 18, 2024

At the time I added mixins, there were only a few, either in the open source code or in the google3 version. If all the mixins handle readonly protobufs correctly then there is no issue. It might be good to update them to call isFrozen?

I think this bug was to document the workaround and to warn about what might go wrong if the ability to add mixins was used more widely. (For example, users started writing their own mixins.)

It probably could be closed. If someone were to write a guide to implementing protobuf mixins then it should have a reminder to handle the frozen case correctly, but it doesn't seem too likely?

from protobuf.dart.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.