评论中的装饰器是否对代码有影响?

问题描述 投票:2回答:1

我已经看到了一些代码,其中装饰器在注释中,这些注释被突出显示 - 请参阅我的示例来自this code,所以我想知道这些代码行是否有任何影响。这是一个例子:

/**
 * Instanciate a new Payment.
 * @param payplugApi Object  The PayplugAPI with sucessfull authentication
 * @param paymentTracker String  A payment tracker (id) that will be send and received by PayPlug API to follow the payment. This tracked will be inserted in metadata
 * @param payment   Object  The payment options. More informations here : https://www.payplug.com/docs/api/apiref.html?powershell#create-a-payment
 * @return [nothing]
 * @see PayPlugAPI.authenticate The authentication method
 */
var Payment = function () {...}

它只是文档或执行代码?

任何提示都会很棒,谢谢!

javascript decorator
1个回答
6
投票

这些是JSDoc comments,并且为了生成文档(以及IDE中的“悬停” - 提示等)而进行解析。他们与装饰者没有任何关系。

© www.soinside.com 2019 - 2024. All rights reserved.