Commit 4e00b19f authored by Rene Saarsoo's avatar Rene Saarsoo
Browse files

Turn @readonly into builtin Tag class.

parent fcd3bc3a
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
require "jsduck/meta_tag"
require "jsduck/builtins/boolean_tag"

module JsDuck::Tag
  # Implementation of @readonly tag
  class Readonly < JsDuck::MetaTag
module JsDuck::Builtins
  class Readonly < BooleanTag
    def initialize
      @name = "readonly"
      @key = :readonly
      @signature = {:long => "readonly", :short => "R O"}
      @boolean = true
      super
    end
  end
end
+1 −1
Original line number Diff line number Diff line
@@ -44,7 +44,7 @@ describe JsDuck::Aggregator do
    end

    it "gets readonly attribute" do
      @doc[:meta][:readonly].should == true
      @doc[:readonly].should == true
    end
  end

+1 −1
Original line number Diff line number Diff line
@@ -717,7 +717,7 @@ describe JsDuck::Aggregator do
    end

    it "keeps @readonly" do
      @property[:meta][:readonly].should == true
      @property[:readonly].should == true
    end

    it "overrides @deprecated of parent with its own @deprecated" do