source: imaps-frontend/node_modules/webpack/lib/runtime/HasOwnPropertyRuntimeModule.js@ 79a0317

main
Last change on this file since 79a0317 was 79a0317, checked in by stefan toskovski <stefantoska84@…>, 3 days ago

F4 Finalna Verzija

  • Property mode set to 100644
File size: 858 bytes
Line 
1/*
2 MIT License http://www.opensource.org/licenses/mit-license.php
3 Author Sergey Melyukov @smelukov
4*/
5
6"use strict";
7
8const RuntimeGlobals = require("../RuntimeGlobals");
9const RuntimeModule = require("../RuntimeModule");
10const Template = require("../Template");
11
12/** @typedef {import("../Compilation")} Compilation */
13
14class HasOwnPropertyRuntimeModule extends RuntimeModule {
15 constructor() {
16 super("hasOwnProperty shorthand");
17 }
18
19 /**
20 * @returns {string | null} runtime code
21 */
22 generate() {
23 const compilation = /** @type {Compilation} */ (this.compilation);
24 const { runtimeTemplate } = compilation;
25
26 return Template.asString([
27 `${RuntimeGlobals.hasOwnProperty} = ${runtimeTemplate.returningFunction(
28 "Object.prototype.hasOwnProperty.call(obj, prop)",
29 "obj, prop"
30 )}`
31 ]);
32 }
33}
34
35module.exports = HasOwnPropertyRuntimeModule;
Note: See TracBrowser for help on using the repository browser.