When we are using Phantomjs in our project in conjunction with Base2 library, we are getting the following error:
+ phantomjs ...../src/test/javascript/SpecRunner.html
TypeError: setting a property that has only a getter
Can anyone point out how to fix this issue? It seems it occurs due to Javascript "strict mode" inside Phantomjs (refer here), but could not find from Phantomjs docs on how to turn this off, especially since it occurs in the external lib (Base2.js) that we need?
Thanks,
Paddy
Base2.js does not seem to define "use strict". This means that in one of your javascript files you have a "use strict" line outside of any function. This turns on strict mode at the point it is defined and you can not turn it off again. It is better to turn it on only inside function declarations.
To figure out this problem, search for "use strict" or 'use strict' in all files included in your project. Then remove them or move them inside function bodies.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions_and_function_scope/Strict_mode
Can I disable ECMAscript strict mode for specific functions?
Related
I want to copy the uploaded files the source input element to the destination input element. That is,I just assign the input.files from first element to the second element with the help of change event. I am getting wondered, it is not working in Edge browser.
It throws Assignment to read-only properties is not allowed in strict mode
Here's what I've tried.
https://stackblitz.com/edit/typescript-kobcul?file=index.ts
Hope I get some solution.
Currently we don't have an option to assign the files to the input type file in edge browser. It seems to be a browser behaviour.
Looks like issue caused by Strict mode. If possible then try to make a test with simple JS instead of using type script. Try to disable the strict mode if possible for you may help to avoid the issue.
To disable the Strict mode, You need to add add "noImplicitUseStrict": true to "compilerOptions" in tsconfig.json.
Compiler Options:
tsconfig.json
It is not possible to disable it dynamically. Because code needs to be complied again after you enable or disable it.
While debugging my React Native app in Chrome, I'm often unable to set breakpoints in the Sources tab. When I click on a line of code to add the breakpoint, a breakpoint is added instead to the next function declaration line in my module.
This doesn't happen in all of my source modules, but often enough that it prevents me from debugging efficiently.
I'm currently using RN 0.22 but this has been happening on older versions of RN as well (e.g. RN 0.18).
This problem maybe caused by babel. When use normal function and arrow function together, it happened.
"sourceMaps": "inline" in .babelrc fixed this for me.
I've only experienced this issue under the following conditions:
1) The .js file contains multiple functions, and
2) Attempting to set a breakpoint within a function that is not the last function in the .js file
So, a partial workaround is to move a function such that it is the last function in the .js file. Or, you could assign a single function per file. Either way, you will be able to set breakpoints.
This is far from ideal, but it's the only "solution" I've found so far.
I had the same issue, and I have a cozy solution for now :
I put the word "debugger" in the file which I want to debug.
I refresh the browser to see that it stops.
after it stops, I can add as much as breakpoints as I want and remove the "debugger" word from file
Try this package
https://www.npmjs.com/package/react-breakpoint-fix
just install the package and run react-breakpoint-fix from the terminal.
This fixed it for me. I'm using react-scripts#3.x
In DOXYGEN, initially before Generate_TreeView is checked (i.e, when disabled), when I click on the side function choosing pane, I get the correct documentation of the function. But after Generate_TreeView is checked and when clicked on any function to view its corresponding documentation it shows the File reference instead of documentation. One thing to be noted is : I am generating separate member pages for all the functions.
I got the solution !! Make sure you have checked "SEPARATE_MEMBER_PAGES" in DOXY-Wizard !! I had the following issue in DOYGEN 1.8.4 but once I started using DOXYGEN 1.8.7, the issue got resolved !! Just a version issue !!
In my Dojo build, I'm pulling in some third party libraries.
As I go through the build process, I'm getting errors due to ReferenceErrors.
This is fine. This makes sense.
However, I'd like to tell the Dojo build process about the things that are being referenced. In essence, this would be akin to passing externs to the Closure Compliler.
Thus, my question: How do I tell the Dojo build process about references that it cannot infer from my code base?
This is using Dojo 1.8
I just ran into this myself. Now I'm assuming that the ReferenceErrors you referred to are for browser objects like navigator, window, document, and the like. If so, then this is a problem introduced by the Dojo build process itself, because the build is performed by dojo.js running inside of Rhino where browser global objects are not defined. It's a dojo/Rhino error, not a closure compiler error, so there's nothing you can pass to closure to change this. For example, a script like
(function(){
window.alert("hello");
})();
will break your dojo build if it is included in a dojo layer. When the dojo AMD loader resolves the dependency of a script like the above, it will run the body of the function, resulting in a ReferenceError because window does not exist in Rhino.
To get around this, wrap the script as an AMD module
define([], function(){
window.alert("hello");
});
and then the function body will NOT be executed by the AMD loader during dojo build.
I'm using a static lib thats giving me a warning when uploading my binary for review by apple.
The method in the static lib that causes the warning(non-public selectors) is never called by me, its corresponding .h is deleted from my proj, but warning still persists.
Given that I know the method name causing the problem, is there a way for me to open/edit this .a and comment/delete the offending piece of code and then use the modified .a in my project.
I don't have access to the .a source to recompile it, and its very old and the creator of it has no contact details for me to track down.
Many Thanks,
-Cake
Quick and dirty solution: Open the .a file in a hex editor and change all instances of the name. Leave the function name the same length so that offsets in the file don't change, just change a letter or something like that. I did a quick test, adding a dummy function to a subproject we're building as a static library then tweaking the function name in the .a file (there were five instances, for what that's worth) and everything built okay. I don't see any reason it wouldn't pass the App Store check after that.
I'm really surprised the function was still there in the final build, though—I thought Dead Code Stripping was supposed to clean out any unused code. Huh.
http://opensource.apple.com/source/cctools/cctools-809/
I don't presume to get your bounty, because I haven't provided an easy solution. But yes, it in theory is possible. You have your work cut out for you.
There are several solutions, depending on your lib and project.
In your build settings :
Enable "dead code stripping" if possible : If the method is never used (even internally), the symbol will be deleted.
Use "Unexported symbol file" : Simply add the symbol into a file and it will be removed from the binary. This will work even if the symbol is used internally.
Enable "Deployment Postprocessing" and "Strip Linked Product" with "Strip Style" set to "All symbol"
(Not sure) Use "Symbols Hidden by Default". This is related to the code generation and should not affect linking, but just in case everything above failed...
No need to hack the binary files. Just turn off the compiler's "unused selectors" warning: -fno-unused-selectors.